Is there a way to have searched through a text file like:
char line[256];
ifstream afile("c:\somefile.txt"
afile.getline(line, 255, '\n');
and assume that the first line of the text file was:
256.4223
That would mean that line[0] is = 2, [1] = 5 etc....
now lets say I have a float:
float x;
and I want x to equal the scanned number, 256.4223.
I can't say:
x = static_cast<float>(line);
this doesn't work. so what can I do to make x equal a number that was input from a text file?
-RSTR benthecat@hotmail.com
char line[256];
ifstream afile("c:\somefile.txt"
afile.getline(line, 255, '\n');
and assume that the first line of the text file was:
256.4223
That would mean that line[0] is = 2, [1] = 5 etc....
now lets say I have a float:
float x;
and I want x to equal the scanned number, 256.4223.
I can't say:
x = static_cast<float>(line);
this doesn't work. so what can I do to make x equal a number that was input from a text file?
-RSTR benthecat@hotmail.com