Here's a quick bit of code I whipped up to read in a text file containing 100 csv entries composed of 10 comma-separated integers.
FILE *pFile = fopen("test.txt","r");// temporary storage for the values.int n1,n2,n3,n4,n5,n6,n7,n8,n9,n10;while(!feof(pFile)){ fscanf(pFile,"%d,%d,%d,%d,%d,%d,%d,%d,%d,%d\r\n", &n1,&n2,&n3,&n4,&n5,&n6,&n7,&n8,&n9,&n10); // do something with the data.}fclose(pFile);/* Sample data:24464,26962,29358,11478,15724,19169,26500,6334,18467,415436,4827,11942,2995,491,9961,16827,23281,28145,570519895,19718,18716,17421,12382,292,153,3902,14604,323919894,17035,26299,25667,19912,1869,11538,14771,21726,54476868,28253,7711,15141,4664,17673,30333,31322,23811,28703778,27529,9741,8723,12859,20037,32757,32662,27644,25547*/
I dunno how fscanf would compare to reading in a line and tokenizing it using something like strtok, but it's gotta be faster than going char by char.