reading the next line using fscanf
the first two lines in a file are
W1 44444 WingThing 20
W1 2222 SmallThing 8
why in the last fscanf i dont get
a=W1
b=2222
c=SmallThing
??
Code:
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#define false 0
#define true 1
int main()
{
FILE *f;
char a[20];
char b[20];
char c[20];
f=fopen("c:\\ware1.txt","r");
fscanf(f,"%20s%20s%20s",a,b,c);
fscanf(f,"100[^\n]",a);//put in "a" the un wanted chars till you get \n
fgetc(f); \\go to the next line
fscanf(f,"%20s%20s%20s",a,b,c);
fclose(f);
return 0;
}