   ifstream - read X bytes
  How do I read X bytes from an Ifstream, without using getline()... because I want to be able to see the newlines...  I think that I could just ifstream:eek() my way through the whole thing, and read bit-by-bit, but this seems somewhat slow...    ==================My (soon-to-be) Cherished Cookie of Appreciation:-- MattB - for WinSock advice --  
ifstream in(filename); //open filein >> noskipws;   //don''t skip whitespaceint numread=in.readsome(buffer,X) //read up to X bytes into buffer, not null terminated ;  Data can be just about anything really, including a struct (and probably a class, but I think you''d need a copy constructor).ifstream in(filename, ios::binary);in.read((char *)&data, x); // x is the number of bytes to read  