you must be missing the basic concept of printf here. printf takes your format string and inserts the variables you give it in to it where the various % codes are. so to print a doubleOriginally posted by niroopan
also how do you add a blank space using printf();
printf ("%f", mydouble);
to print a double with a space after it
printf ("%f ", mydouble);
also, you really shouldnt be using freopen here, theres no need to. just use
fprintf (myfile, "%f ", mydouble);
(that is after you fopen() myfile of course)