Saved Bookmarks
| 1. |
Find the output of the following C++ code considering that the binary file CLIENTS.DAT exists on the hard disk with a data of 200 clients:class CLIENTS{int CCode; char CName[20]:public: void REGISTER();void DISPLAY();}; void main(){ fstream File;File.open("CLIENTS.DAT", ios: :binary | ios::in);CLIENTS C;File.seekg(6*sizeof(C));File.read((char*)&C, sizeof(C));cout<<"Client Number<<File.tellg()/sizeof(C)+1;File.seekg(0, ios::end);cout<<"of "<<File.tellg()/sizeof(C)<<end1;File.close();} |
|
Answer» Output Client Number: 8 of 200 |
|