Reading lines (content in file)

Started by Dodge, May 03, 2006, 10:46:58 PM

Previous topic - Next topic

Dodge

Hi i have a simple code , but it doesnt work correctly:

#include <stdio.h>
main(){
char table[200];
int i;
char c;
FILE  *f;
f=fopen("TestFile.txt","r");
fscanf(f,"%i",&i);
fscanf(f,"%c",&c);
fscanf(f,"%s",&table);

while(feof(f)==0){
fgets(niz,100,f);
printf("%s\n",table);
}
fclose(f);
}

This code displais all lines in file...accept first one...it cuts the first "string" (?)
Can someone please explain to me where i go wrong? #-o

CLR


Dodge

Hmm ok ... found my mistake...thnx =D>