Quick links
Write a C program to copy contents from one file to another. Logic to copy contents from one file to another file in C program. How to copy contents from one file to another using functions in C programming.
Write a C program to copy contents from one file to another. Logic to copy contents from one file to another file in C program. How to copy contents from one file to another using functions in C programming.
Write a C program to read contents of two files and compare them character by character. How to compare two files character by character and line by line in C programming. Logic to compare two files line by line and print difference line and column number in C program.
Example
File 1
Learn C programming at Codeforwin. Working with files and directories.
File 2
Learn C programming at Codeforwin. Working with array and pointers.
Output
File are not equal. Line: 2, column: 14
Write a C program to read data from user and append data into a file. How to append data at end of a file in C programming. In this post I will explain append mode in file handling. I will cover how to append data into a file in C using append file mode.
Example
Source file content
I love programming. Programming with files is fun.
String to append
Learning C programming at Codeforwin is simple and easy.
Output file content after append
I love programming. Programming with files is fun. Learning C programming at Codeforwin is simple and easy.
Write a C program to input numbers from a file and write even, odd and prime numbers to separate files. How to input numbers from file using fscanf()
and write even, odd and prime numbers to different file.
Write a C program to read a file and display its contents on console. How to read a file and display file contents on console in C programming. In this exercises, I will explain you how to read a file character by character using fgetc()
. How to read a file line by line using fgets()
.
Write a C program to create a file and write contents in it. How to create a file in C programming? C program to input a string from user and store it in a text file. Learn how to create a file and write contents to it in C programming.
Write a C program to input string from user and convert string to long long
using atoll()
library function. How to convert string to long long int
type using atoll()
library function in C programming?
Write a C program to input string from user and convert string to unsigned long long
using strtoull()
library function. How to convert string to unsigned long long int
using strtoull()
library function in C programming?
Write a C program to input string from user and convert string to long long
using strtoll()
library function. How to convert string to long long int
using strtoll()
library function in C programming?
Write a C program to input string representation of integer and convert string to unsigned long
using strtoul()
library function. How to convert string to unsigned long int
using strtoul()
library function in C programming?