Seems like this should be simple, but I don\'t find it in a net search.
I have an ofstream which is open(), and fail() is now true. I\'d li
we need not use std::fstream, we use boost::iostream
#include
#include
void main()
{
namespace io = boost::iostreams;
//step1. open a file, and check error.
int handle = fileno(stdin); //I'm lazy,so...
//step2. create stardard conformance streem
io::stream s( io::file_descriptor_source(handle) );
//step3. use good facilities as you will
char buff[32];
s.getline( buff, 32);
int i=0;
s >> i;
s.read(buff,32);
}