SirhcdP
18th March 2009, 10:05
Hi every one.
I would appreciate it if some one can point me in the right direction. The problem i am having is, I have a line that i read from a file with doubles and ints in the line example
1 2 3 4.5 6.7 2.3
I want to put these numbers in ints and doubles. What i tried to do was.
int one, two, three;
double oned, twod threed;
QTextStream ssFile, line;
ssFile.setDevice(&file);
QString stringFile = ssFile.readLine();
line.setString(&stringFile);
line >> one >> two >> three >> oned >> twod >>threed;
Needles to say it did not work. is there an easy way in doing this.
Thanks in advance
Chris
I would appreciate it if some one can point me in the right direction. The problem i am having is, I have a line that i read from a file with doubles and ints in the line example
1 2 3 4.5 6.7 2.3
I want to put these numbers in ints and doubles. What i tried to do was.
int one, two, three;
double oned, twod threed;
QTextStream ssFile, line;
ssFile.setDevice(&file);
QString stringFile = ssFile.readLine();
line.setString(&stringFile);
line >> one >> two >> three >> oned >> twod >>threed;
Needles to say it did not work. is there an easy way in doing this.
Thanks in advance
Chris