How to read numbers out of a file in c
I have a file that is a mixture of integers and words all strung together with spaces. It is a score for a bowling game it looks like "8 split 1 9 1 spare 7 2 10 strike 8 2 spare 6 split 2 7 3 spare 10 strike 10 strike 10 turkey 8 1" I am trying to figure out how to read the just the numbers out of the file and then rewrite them into another file.
I started with opening the original file and using sscanf to store the values in an array. Will this work with the way the file is formatted right now?