Hi people, I have a file with some data in columns (separated by tabs) like so:
1.23 1.354 2.78
1.44 10.023 2.756
2.31 20.3 10.07
What I need to do is read each line of the file in and put each column in an array/vector (i.e. the first number in each line should go in one array, second number in each line in another, third number in yet another array, if that makes sense). I found a similar thread using strtok() (though the data was delimited by commas, not tabs) here
, but I don't know how to get each line read into a char for strtok(). I can read into a string, though, but then using string's c_str() gives me a const char*.
Any ideas on how to do what I need?