Advertisement



< Prev
Next >



C++ File Pointer - get






In our last article, we have explained how to use the a very important file output/write function - put() function, used to write a character to the file. In this tutorial, we are going to explain how modify the content of an existing file, but before we do that, it is critical to understand the pointer associated with each file, which allow to read the content of a file on disk. This pointer is called get pointer.


File Pointer Description
get
  • The get pointer allows us to read the content of a file when we open the file in read-only mode.

  • It automatically points at the beginning of file, allowing us to read the file from the beginning.



    Before we show you how to access and manipulate with the get pointer to read the content of a file on the disk, we must show you how to open the file. For this, the C++ language provides us stream classes used to perform file input/read operation.




    File I/O Stream Classes


    In order to perform a file input operation using the get pointer, C++ provides us a few file stream classes, such as -

    Please Subscribe

    Please subscribe to our social media channels for daily updates.


    Decodejava Facebook Page  DecodeJava Twitter Page Decodejava Google+ Page




    Advertisement



    Notifications



    Please check our latest addition

    C#, PYTHON and DJANGO


    Advertisement