OOP - Error | Unhandled exception at 0x0FD2CCC8 (msvcp110d.dll)
-
I got below exception while reading data from .dat file using c++ code eof. Unhandled exception at 0x0FD2CCC8 (msvcp110d.dll) in ConsoleApplication1.exe: 0xC0000005: Access violation reading location 0x004DF174. My Code: teacher t1; ifstream file1; file1.open("Teacher.dat",ios::binary|ios::app); file1.seekg(0); while(!file1.eof()) { file1.read((char*)&t1,sizeof(t1)); t1.Display(); } file1.close(); Last record prints multiple time and throwing exception. Please have a look into. Thanks in advance.
-
I got below exception while reading data from .dat file using c++ code eof. Unhandled exception at 0x0FD2CCC8 (msvcp110d.dll) in ConsoleApplication1.exe: 0xC0000005: Access violation reading location 0x004DF174. My Code: teacher t1; ifstream file1; file1.open("Teacher.dat",ios::binary|ios::app); file1.seekg(0); while(!file1.eof()) { file1.read((char*)&t1,sizeof(t1)); t1.Display(); } file1.close(); Last record prints multiple time and throwing exception. Please have a look into. Thanks in advance.