C - 3rd line on a txt

Posted by Pedro on Stack Overflow See other posts from Stack Overflow or by Pedro
Published on 2010-04-26T11:03:23Z Indexed on 2010/04/26 11:13 UTC
Read the original article Hit count: 195

Filed under:
|

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...

© Stack Overflow or respective owner

Related posts about c

    Related posts about homework