C - 3rd line on a txt
- by Pedro
Hi....I have on the txt file this:
Hello
Experience
3
Bad
Hi want to scanf the 3rd line;
i'm doing this:
FILE *fp;
int number;
fp=fopen("test.txt","r");
if(fp==NULL){
printf("Error\n");
}
while(!feof(fp)){
for(i=0;i<=3;i++){
if(i==3){
fscnaf(number,fp);
prinf("string in the 3rd line is %s\n",number);
}
}
}
system("PAUSE");
}
I need to use the fscanf, because i will need it, the number is the size of students in a school...
Something is wrong, but i don't know what is...please help me...