I have something similar to
const char* a = "a\nb";
std::ostream data;
and I need to read "a" into "data". I tried using
data_stream << data;
but that stops at the line end, so only "a" is copied. Next I tried
while (data[0] != '\0')
{
data_stream << data;
}
however this does not remove the line from the char, so it's an endless loop. What's the correct way to do this?
use
getline()
get every line int the char *