We have investigated the elastic constant C33 of Ba(Fe1-xCox)2As2 with eight different Co concentrations by ultrasonic measurement. We found remarkable elastic anomalies near the quantum critical point. We have studied them by measuring the electrical resistivity, heat capacity, and ultrasonic attenuation in addition to the elastic constant. These results have revealed that the inter-layer three-dimensional properties appearing in C33 to be possibly originated from the magnetic character of these materials. Our data about the elastic constant C33 highlight the importance of controlling the c-axis length in the emergence of superconductivity in iron-based superconductors.