0
How can I read a matrix with getline from a file. Please see example. What is the best way to read this from file?thanks
2 3 000 000 000
2 Antworten
0
do you have to use getline()?? if not maybe consider...
Use ifstream to read data from a file:
std::ifstream input( "filename.ext" );
If you really need to read line by line, then do this:
for( std::string line; getline( input, line ); )
{
...for each line in input blah blah lol
}
0
Thank for your answer, do you think that with simple ifstream reading should be ok? Because the first two lines are different, and I am thinking that ,this might cause a problem