something about scanf() and FILE readed
**if the origin FILE opened has following strings:
10,20,30,40,50,60,70
**I want to make them to an array x[n],and n is the amout number of the
FILE,as the example ,n is 7(n is not a const. so i CAN'T declare the correct
length of array before)
**But, my code only can get the first number 10, for when it encount ",",it
was terminated,what should I do?(help me please~)
Code:
/*=======================*/
int x[100];
i=0;
int chk,count;
do{
count=0;
chk =fscanf(fp,"%d",&x[i]);
i++;count++} while(chk!=NULL);
int n=count;