I was about to read a PNG file from stdin using the following code:
std::string input;
char ch;
std::cin >> std::noskipws;
while (!std::cin.eof())
{
std::cin.get(ch);
input += ch;
}
However, I could only get 5 bytes since PNG header contains a Ctrl-Z and stops reading.
What should I do to read the whole file?