Can't write the last part of a txt file to cout using ifstream
问题 The code below will print all of the text from the sample text file I'm using except for the last little snippet of it. I think this has something to do with the eof or the byte size I'm using not working as I expect. #include <iostream> #include <fstream> using namespace std; int main(int argc, char* argv[]){ int length; char* buffer; //get file stream and open local file. ifstream stream; stream.open("SampleFile.txt", ios::binary); stream.seekg(0, ios::end); length = stream.tellg(); stream