Question:
Find the output of the following C++ code considering that the binary file CLIENTS.DAT exists on the hard disk with records of 100 members.
class CLIENTS
{
int Cno;char Name[20];
public :
void In(); void Out();
};
void main{)
{
fstream CF;
CF.open("CLIENTS.DAT",ios:: binary| ios::in) ;
CLIENTS C;
CF.read((char*)&C,sizeof(C));
CF.read((char*)&C,sizeof(C));
CF.read((char*)&C,sizeof(C));
int POS=CF.tellg()/sizeof(C);
cout<<"PRESENT RECORD:"<<POS<<endl;
CF.close() ;
}
C. Sir| Created: 5-Jan-2019 | Updated: 1-Apr-2019|CBSE12D-2015
