c - Scanning values from file using fscanf -


hey need read data file , print it(i have use fscanf). code works first value when add more it's not working. here code

char name[5];    //this value fixed size char isworking; double latitude;  //the length may vary double longitude; //the length may vary while(fscanf(fp2,"%s %c %lf %lf",name,isworking,latitude,longitude) == 4)  {  printf("\n%s %c %lf %lf",id,type,latitude,longitude);  i++;  } 

my file looks that

bob1 y 122.232323 -9.323232 bob2 n 9.0001 -9.001 

it doesn't print except when remove other values , try read name


Comments

Popular posts from this blog

javascript - How to synchronize the Three.js and HTML/SVG coordinate systems (especially w.r.t. the y-axis)? -

javascript - How do I find how many occurences are there of a highlighted string, and which occurence is it? -

java - Reading data from multiple zip files and combining them to one -