The forcing to add $\kappa$ many Cohen reals is c.c.c and thereby preserves all cardinals but destroys the fact that $\kappa$ is even strongly inaccessible. (See for example Kunen "Set Theory: An Introduction to Independence Proofs" North-Holland, Ch. VII.)