Question:
Find the output of the following C++ code considering that the binary file MEMBER.DAT exists on the hard disk with records of 100 members:
class MEMBER
{
int Mno; char Name[20];
public:
void In();void Out();
};
void main()
{
fstream MF;
MF.open("MEMBER.DAT”,ios::binary|ios::in);
MEMBER M;
MF.read((char*)&M,sizeof(M));
MF.read((char*)&M,sizeof(M));
MF.read((char*)&M,sizeof(M));
int POSITION=MF.tellg()/sizeof(M);
cout<<"PRESENT RECORD:"<<POSITION<<endl;
MF.close();
}
C. Sir| Created: 8-Jan-2019 | Updated: 22-Mar-2026|CBSE12A-2015
