When the program execute, there will an error occur.
If put a "break" after the tra[i].displayTran(), the program cannot display all the transaction record.
How to solve the problem?
Code:case 'T': acctType=men.typeMenu(); if(acctType=='C') { int acNo; system("cls"); r.open("transaction.txt"); cout<<"\nTransaction done"; cout<<"\nEnter your checking account number: "; cin>>acNo; for(int i=0;!r.eof()+1;i++) { r.read((char*)(&tra[i]),sizeof(tra[i])); if(acNo==tra[i].getacctNum()) { tra[i].displayTran(); } } r.close(); break; } if(acctType=='S') { sav[n].deposit(); break; } else { cout<<"Invalid type"; cout<<"\n\nPress ENTER to continue..."; while(!cin.get()){}; while(!cin.get()){}; } break;