I'm trying to read a file(a ROM actually). The thing is that my program stops before actually reaching the end of the file. Here's what I wrote:
int main(){
cout << "Entter the file to read in HEX: " ;
string fileName;
cin >> fileName;
ifstream streamLecture(fileName);
unsigned char charLu;
while(!streamLecture.eof()){
streamLecture >> charLu;
cout<< hex << setw(2) << setfill('0') << short(charLu) << ' ';
}
streamLecture.close();
cout << endl;
}
This program cout a few lines of HEX values but I know there are a lot more since I read the file in a HEX editor program.
EDIT: Ok, so i'm assuming there is an EOF in the middle of my file, how do I skip it or continue reading afterwards? Thanks again