I am confused what is the efficient way to read in a file with multiple values per line. Each value is separated by a space character. The values could be characters or real values.
I am using ifstream to get the file by passing it a c string as the filename but I am using a c++ string to get each line with getline(). But to get the individual values I think the only way is to use strtok() which needs a c string as input. To convert a string to a double would I use atod(). This seems very difficult.
I am using ifstream to get the file by passing it a c string as the filename but I am using a c++ string to get each line with getline(). But to get the individual values I think the only way is to use strtok() which needs a c string as input. To convert a string to a double would I use atod(). This seems very difficult.
Comment