X-Authentication-Warning: delorie.com: mail set sender to djgpp-bounces using -f Message-ID: <20040903112112.2073.qmail@web20227.mail.yahoo.com> Date: Fri, 3 Sep 2004 04:21:12 -0700 (PDT) From: pradyut bhattacharya Subject: file I/O To: prgc AT yahoogroups DOT com, djgpp AT delorie DOT com MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii i have written a small file on object I/O. the code ---------------------------------------------- #include #include class student { private: int Regno; char cName[20]; public: void setRegno() { cout<<”Enter the registration number: “; cin >>Regno; } void setName() { cout <<”\nEnter the name of the student: “; cin >>cname; } int getRegno() { return Regno; } char *getName() { return cName; } }; int main() { ofstream sfil(“studfile.dat”); char ch; student svar; svar.setRegno(); svar.setName(); sfil <>ch; if (ch == ‘y’) { ifstream sfil(“studfile.dat”); char iregno; char nam[20]; sfil >>iregno >>nam; cout <<” \n Registration number is: “ <