Saved Bookmarks
| 1. |
Find the output of the following C++ code considering that the binary file sp.dat already exists on the hard disk with 2 records in it. class sports { int id;char sname[20]; char coach[20];public:void entry();void show(); void writing(); void reading(); }s; void sports::reading() { ifstream i;i.open("sp.dat");while {i.read((char*)&s, sizeof(s)); if(i.eof()) break; else cout<<"\n" <<i.tellg();} i.close(); }void main() {s.reading(); } |
|
Answer» Output 42 84 |
|