I am trying to open a text file and save the float values to a specific memory-address to work with them in an assembly-program. My problem is that I have a restriction to the format of the values in the text file:
if(sscanf(line,"%f mm %f mm",
&data1[linesread], &data2[linesread]) != 2)
{
fprintf(stderr, "Error in line: %s\n",line);
fprintf(stderr, "Aborted.");
break;
}
What does %f mm %f mm
in sscanf()
stand for?
%f
means that the first and the second value of the line have to be a float-value but I don't understand what "mm" means.
When I try to read in a line formatted like this:
5.0 2.0
I always get:
Read: 5.0 2.0
Error in line: 5.0 2.0
Aborted.
Maybe you can try this