Reading text line and extract integer from each line

Jun 4, 2013 at 5:45pm
Hello guys!

I would like some help with C firstly. I hope I am not out of topic.

I have a txt file , every line will be like
Producer 0 added 90
Producer 1 added 83
etc.

I want to extract the numbers 90,83 etc.
Do you know any functions that would be helpful. I think fgets and sscanf could help me..

Thanks in advance!
Jun 4, 2013 at 6:06pm
The functions mentioned could be useful. Perhaps strrchr and atoi might be useful too / instead.
http://www.cplusplus.com/reference/cstring/strrchr/

there is also strtok, but that might be too much work.
Topic archived. No new replies allowed.