I have a C code that is using the base structure for reading.
Read
FILE *input;
input=fopen(argv[1],"r");
points=(Point*)malloc(sizeof(Point)*num_points);
readPoints(input,points,num_points);
fclose(input);
Save
FILE* output=fopen(argv[2],"w");
fprintf(output,"%d\n",num_clusters);
fprintf(output,"%d\n",num_points);
fclose(output);
My question is how can I read a csv file so that I do not know how many lines it has, and then write the data to another csv file. Would it be the same C procedure with EOF /! EOF and the code the way I did, or will it be done differently?
Thank you very much.