Hello, guys!
So, i have a file of thousands of lines containing only numbers from 01 to 99 and one space/tab between them, just like the following example:
37 36 56 27 42 23
05 25 12 10 60 24
25 28 30 33 51 11
...
I want to convert these numbers to "int" and put them in a array of int. In Java, to do that, i read line by line and i use "split( )" method which splits this string given a regular expression, like the following code:
int line[ ] = new int[ 6 ];
for( String str: br.readLine().split( "\\s+" ) ) { //"\\s+" skips spaces/tabs
line = Integer.parseInt( str );
}
int line[ ] = new int[ 6 ];
for( String str: br.readLine().split( "\\s+" ) ) { //"\\s+" skips spaces/tabs
line = Integer.parseInt( str );
}
To copy to clipboard, switch view to plain text mode
I would like to know how can i do that using Qt libraries if is possible or how can i do that in C++.
Thanks!
Bookmarks