Hi,
I'm trying to read from a file a char for time (that are float eg line of file: 1.1 1.0 3);
Qt Code:
  1. vector <vector <float> > example;
  2. char ch;
  3. string s;
  4. int i=0,j=0;
  5. while (f.readChar(ch)) { //this is my function return a char on ch
  6. cout.put(ch);
  7. if (ch == '\n') lines++;
  8. else if (ch != ' ') {
  9. s += ch;
  10. } else {
  11. example[i][j] = atof(s.c_str()); //but here a runtime error uccurs
  12. s="";
  13. j++;
  14. }
  15.  
  16. i++;
  17. }
To copy to clipboard, switch view to plain text mode 
How to do that conversion? And then: is this the easier way to reach my aim? (I suspect it can be more simple).
thanks