Hi ,
I have this code which is capable to read from file only one column , I need it read two column. So, how can I alter it to read from file and place the value in array ?
Note : the data file format like that :

10.2 30.3 12.4 ........
34.56 45.9 34.5.......
12.3 12.45 10.10.....
.
.
.
Qt Code:
  1. QTextStream in(&file);
  2. unsigned int max_lines = 20000; // we choose 102 because in the real file there are two header lines in the top of file
  3. float data[max_lines];
  4. unsigned int lines_read =0;
  5.  
  6. for(int i=lines_read ;i<max_lines;i++)
  7. {
  8. double x;
  9. QString content;
  10. in >> x;
  11. content = content.setNum(x);
  12.  
  13. data[i]=content.toDouble();
  14. in.readLine();
  15. lines_read++;
  16. }
To copy to clipboard, switch view to plain text mode