Hi
I have a text file like this:
2
A 10 5
B 31 2
C 6 6
I want to read first line number in a variable
and read each line's space separated list of 3 values in 3 variables.
I wrote this code:
iF=fopen(fileName,"r");
fgets(tmp,255,iF);
sscanf(tmp,"%d",&interval);
while(!feof(iF)){
cur=(P *)malloc(sizeof(P));
fgets(tmp,255,iF);
sscanf(tmp,"%c %d %d",&Name,&AT,&ET);
cur->jobName=Name;
cur->arrivalTime=AT;
cur->execTime=ET;
add_to_list(head,cur);
}
It works correctly for lines 1,3,4 but not for line 2! in line 2 it stores nothing! As I check in Debugger some strange chars are in the file (\342\200\252) and I don't know where are they from!?
What's the problem?
Thanks