The formats FortranForm and CForm of Mathematica are not very efficient. A package Format.m written by M. Sofroniou, Efficient Symbolic-Numeric Computations Using Mathematica is very helpful here. As it seems difficult to find this program on the internet I collect it here