×

C++ Programs

C++ Most popular & Searched Programs

C++ Basic I/O Programs

C++ Constructor & Destructor Programs

C++ Manipulators Programs

C++ Inheritance Programs

C++ Operator Overloading Programs

C++ File Handling Programs

C++ Bit Manipulation Programs

C++ Classes & Object Programs

C++ File Handling (Streams) Programs, Examples

This section contains solved programs on C++ programming language File Handling programs, file stream examples.

Files/streams are the set of characters, using C++ programs, we will learn to write, read data in, from the files (both text and binary).

List of C++ File Handling (Streams) Programs, Examples

  1. C++ program to create a file.
    This program will create a simple text file, check file is created successfully or not and then close the file.
  2. C++ program to read a text file.
    This program will read text from text file, character by character in C++.
  3. C++ program to write and read text in/from file.
    This program will create a text file, check file created or not, if created it will write some text into the file and then read the text from the file.
  4. C++ program to write and read values using variables in/from file.
    This program will write/read variable values in/from the file.
  5. C++ program to write and read object using read and write function.
    This program is quite good, it will write, read object (through member functions) data in, from the file.
  6. C++ program to demonstrate example of tellg() and tellp() function.
    This program will demonstrate the example of tellg() and tellp() function, these are the get and put pointers to tell (return) the current position of file pointer (get/put).

  7. C++ program to write and read time in/from binary file using fstream.
    This program will write, read time in, from the file using fstream, fstream is the set of classes with member function, that are used to communicate (read, write and more) with the files.
  8. C++ program to write and read an object in/from a binary file.
    This program will write, read object (through member functions) in, from binary file.
  9. C++ tellg(), seekg() and seekp() Example
    Here, we are going to learn how tellg(), seekg() and seekp() functions works in C++ programming language? C++ program to demonstrate example of tellg(), seekg() and seekp() functions.
  10. Read integers from a text file with C++ ifstream
    Given a file containing integer numbers, we have to read integers from this file using C++ stream.
  11. Read data from a text file using C++
    Given a text file (or, create a text file, then insert data in it), the task is to read data from this text file using C++.
  12. How to append text to a text file in C++?
    Given a text file, write a C++ program to append text in it.

Comments and Discussions!

Load comments ↻





Copyright © 2024 www.includehelp.com. All rights reserved.