I want to write data from a C program to a file, so that Excel can read the file to plot a graph of the data. But I\'m not sure of the exact syntax to use for fprintf. I have st
Your logic should look something like this:
fp = fopen( "out_file.txt", "w" ); // Open file for writing while ( some condition ) { ... some calculations fprintf(fp, "x = %f, y = %f, vx = %f, vy = %f, time = %f, ", x,y,vx,vy,time); } fclose(fp);