It's like readsome isn't even reading. Returns 0 and doesn't read any chars. What is wrong here?
#include <fstream>
#include <iostream>
int main ()
{
std::fstream stream("list.cpp", std::ios::in);
if (stream.good() || !stream.bad() || stream.is_open()) {
std::cout << "Well, stream looks good." << std::endl;
char justOneChar = 'L';
auto ssize = stream.readsome(&justOneChar, 1);
std::cout << ssize << " : " << justOneChar << std::endl;
}
return -1;
}
Output:
Well, stream looks good. 0 : L