© 2014 Firstsoft Technologies (P) Limited. login
Hi 'Guest'
Home SiteMap Contact Us Disclaimer
enggedu
Quick Links
Easy Studies

Home Lab Exercise Object Oriented Programming Lab Exercise Programs CPP Program To Implement Random Access File Handling▼


CPP Program To Implement Random Access File Handling

Alogarithm steps:

  1. Start the program
  2. Create the base class and declare the data member under protected access specifier and declare the function
  3. Create the derived class and access the base class data members in the derived class
  4. Create the object for derived class
  5. Call the public member function of the derived class
  6. Compile and run the program

CPP Program To Implement Random Access File Handling

#include #include #include void main(int argc,char *argv[]) { char ch; clrscr(); if(argc!=3){ cout<<"Usage Starting Location\n"; } ifstream in(argv[1],ios::in | ios::binary); if(!in){ cout<<"Cannot open a file"; } in.seekg(0,ios::beg); while(in.get(ch)) cout<

SAMPLE INPUT AND OUTPUT:

 Usage Starting Location

First Character

 
SLogix Student Projects

⇓Student Projects⇓
⇑Student Projects⇑
bottom