I am trying to read multiples integers from a file using a loop. The problem I am facing is there's a string in between those integers. My goal is to find the last integer in the file
ex:- 123 hello 1253 world
So in the above case, the last integer would be 1253.
int id;
p=fopen("o.txt","r");
while(!feof(p))
{
fscanf(p,"%d",&id);
fseek(p,13,SEEK_CUR);
} ```
I used `fseek()` to jump over the string. There were 13 characters from the last digit to the beginning of the next digit.
This does not work and I ended up in an infinite loop.
Can anyone help?
Thank you