Make sure that your code to read the data is working by just reading and then writing out the data you've just read in.

A common error in C is to read a double with "%f"; you must use "%lf" ("%f" is for float).