Coupon Accepted Successfully!



  1. Nowadays, a huge amount of data is processed in the computer networking. The information is uploaded or downloaded from the desktop computer. The information transfer in computer networking in day-to-day life is done in the form of files. The data are saved in the file on the disk. The file is an accumulation of data stored on the disk.
  2. A stream is nothing but the flow of data. In the object-oriented programming, the streams are controlled using the classes.
  3. The istream and ostream classes control the input and output functions, respectively.
  4. The iostream class is also a derived class. It is derived from the istream and ostream classes. There are another three useful derived classes. They are istream_withassign, ostream_withassign, and iostream_withassign, and they are derived from istream, ostream, andiostream, respectively.
  5. filebuf accomplishes input and output operations with the files. The fstreambase acts as a base class for fstream, ifstream, and ofstream. The ifstream class is derived from the fstreambase and istream classes by multiple inheritance. It can access the member functions such asget(), getline(), seekg(), tellg(), and read(). The ofstream class is derived from the fstreambase and ostream classes. It can access the member functions such as put(), seekp(), write(), and tellp(). The fstream class allows for simultaneous input and output on afilebuf. The member function of the istream and ostream in the base classes starts the input and output, respectively.
  6. The following two methods are used for the opening of a file: (A) Constructor of the class; (b) Member function open() of the class.
  7. The class ofstream creates output stream objects, and the class ifstream creates input stream objects.
  8. The close() member function closes the file.
  9. The open() function uses the same stream object. The open() function has two arguments. The first is the file name, and the second is the mode.
  10. When the end of the file is detected, the process of reading data can be easily terminated. The eof() function() is used for this purpose. The eof() stands for the end of the file. It is an instruction given to the program by the operating system that the end of the file is reached. The eof() function returnsone when the end of the file is detected.
  11. The mode ios::out and ios::trunc are near about same. The ios:: app lets the user add data at the end of the file, whereas ios: ate allows the user to add or update data anywhere in the file.
  12. The seekg() function shifts the associated file’s input (get) file pointer. The seekp() function shifts the associated file’s output (put) file pointer.
  13. seekg() -- Shifts input ( get ) pointer to a given location
  14. seekp() -- Shifts output (put) pointer to a given location
  15. tellg() -- Provides the present position of the input pointer
  16. tellp() -- Provides the present position of the output pointer
  17. The put() and get() functions are used to read or write a single character, whereas the write() and read() functions are used to read or write blocks of binary data.
  18. The fail(), eof(), bad(), and good() are error trapping functions.
  19. An executable program that performs a specific task for the operating system is called a command. The commands are issued from the command prompt of the operating system. Some arguments are to be associated with the commands; hence, these arguments are called command-line arguments.
  20. Syntax - main ( int argc, char * argv[]);

Test Your Skills Now!
Take a Quiz now
Reviewer Name