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 - ScrollTo Effect (href to div) -

javascript - ng-class not responding to change in model in Angular? -

javascript - document.registerElement extending HTMLInputElement prototype while using custom tag name to avoid implicit browser style -