C program to compare two files

Quick links

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

Continue reading C program to compare two files

C program to append data to file

Write a C program to read string from user and append data to file. How to append data at end of a file in C programming. How to open file in append mode and append data to file.

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.

Continue reading C program to append data to file