K
khalid302
I need to read a specific number of characters into an std::string
from a file regardless of the characters read.
* fstream operator>> stops when it runs into a white space character.
* The global variant of fstream::getline works with std:string but
does not take a 'width' parameter.
* ifstream::get takes a 'width' parameter but does not work with
std::string.
I simply want to read a specific number of characters and only stop on
EOF. Is there any straight forward way to do it ?
from a file regardless of the characters read.
* fstream operator>> stops when it runs into a white space character.
* The global variant of fstream::getline works with std:string but
does not take a 'width' parameter.
* ifstream::get takes a 'width' parameter but does not work with
std::string.
I simply want to read a specific number of characters and only stop on
EOF. Is there any straight forward way to do it ?