So I have a .txt file that is declared as fin, and I need to use fscanf to designate parts of the file to certain variables.
The file looks like this:
L. J. Cool: -39.2/27.25
I need to create an fscanf statement that will read a single line, storing the name (including the space if present, but not the colons) in a character array name, and the two floats into the already declared variables x and y.
How would I pull thiss off?
fscanf(fin,"%s %f %f", name, x, y);
But the exam proctor told me I was wrong without any reason...help please.