0
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);
Record
FILE* output=fopen(argv[2],"w");
fprintf(output,"%d\n",num_clusters);
fprintf(output,"%d\n",num_points);
fclose(output);
My question is how I can read a csv file so that I don’t know how many lines it has and after that record the data in another csv file. It would be the same C procedure with EOF/! EOF and the code the way I did, or it will be done differently?
Thank you very much.