Courses
Tutorials
Practice
Data Structure
Java
Python
HTML
Interview Preparation
DSA
Practice Problems
C
C++
Java
Python
JavaScript
Data Science
Machine Learning
Courses
Linux
DevOps
SQL
Web Development
System Design
Aptitude
GfG Premium
Similar Topics
Web Technologies
37.4K+ articles
DSA
22.8K+ articles
Misc
8.8K+ articles
C++
4.3K+ articles
Strings
3.3K+ articles
C++ Programs
2.4K+ articles
C Language
1.8K+ articles
C Programs
705+ articles
C-File Handling
43+ articles
C++ File Programs
22+ articles
cpp-file-handling
414+ posts
Recent Articles
Popular Articles
File Handling through C++ Classes
Last Updated: 15 May 2025
In C++, programs run in the computer’s RAM (Random Access Memory), in which the data used by a program only exists while the program is running. Once the program terminate...
read more
Misc
Technical Scripter
C++
cpp-file-handling
Find sum of integers in a file which contains any characters
Last Updated: 06 September 2017
You are given a text file which contains any type of characters. You have to find the sum of integer values. Examples:Input : text.txt Let contents of test.txt be : :-,,$%...
read more
Strings
C++
DSA
cpp-file-handling
tellp() in file handling with c++ with example
Last Updated: 12 July 2021
The tellp() function is used with output streams, and returns the current "put" position of the pointer in the stream. It has no parameters and return a value of the membe...
read more
Misc
Competitive Programming
C++
DSA
cpp-file-handling
Set Position with seekg() in C++ File Handling
Last Updated: 05 April 2022
seekg() is a function in the iostream library that allows you to seek an arbitrary position in a file. It is included in the fstream header file and is defined for istream...
read more
Misc
Competitive Programming
C++
DSA
CPP-Library
cpp-file-handling
rename function in C
Last Updated: 21 September 2023
The rename() function is used to rename a file in C. It changes the name of the file from old_name to new_name without modifying the content present in the file. It is def...
read more
Misc
C Language
C++
CPP-Library
cpp-file-handling
C-File Handling
C-Library
Self Destructing Code in C
Last Updated: 21 November 2017
Using remove() function in C, we can write a program which can destroy itself after it is compiled and executed.Explanation: This can be done using the remove function in ...
read more
Technical Scripter
C Language
cpp-file-handling
I/O Redirection in C++
Last Updated: 15 May 2025
In C++, input and output operations are done in the form of sequence of bytes called stream through the stream objects like cin and cout. These objects use different compo...
read more
Misc
C++
cpp-input-output
cpp-file-handling
C++ program to read file word by word
Last Updated: 14 February 2023
Given a text file, extract words from it. In other words, read the content of file word by word. Example :Input: And in that dream, we were flying.Output:Andinthatdream,we...
read more
C++ Programs
DSA
cpp-file-handling
C++ program to append content of one text file to another
Last Updated: 23 November 2022
Given source and destination text files. Append the content from the source file to the destination file and then display the content of the destination file.Example :Inpu...
read more
Misc
C++ Programs
C++
DSA
cpp-file-handling
Program to delete a line given the line number from a file
Last Updated: 20 February 2018
Given a file and a line number n, the task is to delete nth line from the given text file.Suppose the initial content of myfile.txt is :GeeksforGeeksGeeksforGeeks IDEGeek...
read more
Misc
C++ Programs
C++
cpp-file-handling
C Program to find size of a File
Last Updated: 28 April 2018
Given a text file, find its size in bytes.Examples:Input : file_name = "a.txt" Let "a.txt" contains "geeks"Output : 6 BytesThere are 5 bytes for 5 characters then...
read more
Misc
C Programs
C Language
C++
cpp-file-handling
C-File Handling
C++ Program to Create a File
Last Updated: 17 September 2024
Problem Statement:Write a C++ program to create a file using file handling and check whether the file is created successfully or not. If a file is created successfully the...
read more
C++ Programs
C++
cpp-file-handling
Read a record from a File in C++ using seekg() and tellg()
Last Updated: 16 December 2022
Given that a binary file "student.data" is already loaded in the memory of the computer with the record of 100 students, the task is to read the Kth record and perform som...
read more
C++
cpp-file-handling
Custom Jumble Word Game
Last Updated: 10 April 2024
Given a string str, the task is to print all the anagrams of the given string which forms a word that exists in English Dictionary. Note: For using dictionary words, a tex...
read more
Strings
Searching
Sorting
C++ Programs
C++
DSA
cpp-file-handling
File Handling
C program to compare two files and report mismatches
Last Updated: 17 May 2017
We are given almost two identical files. But some characters are corrupted. We need to find the line number and their position where those corrupted letter exists as well ...
read more
C Language
cpp-file-handling
1
2
3
4
...
28
We use cookies to ensure you have the best browsing experience on our website. By using our site, you acknowledge that you have read and understood our
Cookie Policy
&
Privacy Policy
Got It !