What happens if a file contains a \0
character when using istream::getline()
? Will be it be omitted or still assigned into a field in the string buffer?
\0 character in istream::getline()
1.9k views Asked by Niklas R At
2
There are 2 answers
0
On
Assuming you meant istream::getline() I don't see why a null char would ignored. Reading the description on http://en.cppreference.com/w/cpp/io/basic_istream/getline I see nothing that treats \0 in any special way unless you use it as the delimiter.
Short story: it get placed in the extracted string.
From std::istream::getline