Given a text file, find its size in bytes.
Input : file_name = "a.txt" Let "a.txt" contains "geeks" Output : 6 Bytes There are 5 bytes for 5 characters then an extra byte for end of file. Input : file_name = "a.txt" Let "a.txt" contains "geeks for geeks" Output : 16 Bytes
Attention reader! Don’t stop learning now. Get hold of all the important DSA concepts with the DSA Self Paced Course at a student-friendly price and become industry ready.
- C program to copy contents of one file to another file
- C program to check whether the file is JPEG file or not
- Get the stack size and set the stack size of thread attribute in C
- C program to find and replace a word in a File by another given word
- C/C++ program to find the size of int, float, double and char
- Write a C program that displays contents of a given file like 'more' utility in Linux
- C Program to count number of lines in a file
- C Program to print contents of file
- C Program to merge contents of two files into a third file
- C program to delete a file
- C++ program to print unique words in a file
- C Program for Lower Case to Uppercase and vice-versa in a file
- C++ program to read file word by word
- C++ program to append content of one text file to another
- Program to delete a line given the line number from a file
- C program for file Transfer using UDP
- LEX program to add line numbers to a given file
- Lex program to take input from file and remove multiple spaces, lines and tabs
- C++ program to create a file
- Lex Program to print the total characters, white spaces, tabs in the given input file
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to firstname.lastname@example.org. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.