answersLogoWhite

0


Best Answer

Seek to the end of the file (fseek) and check how many bytes are in the file

If the byte count is zero the file is empty.

User Avatar

Wiki User

12y ago
This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: How do you detect an empty file in a c program?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Continue Learning about Engineering
Related questions

Why program consists more than one object file in c?

why does a program consists of more than one object file in c++


Write a C program to extract a given word from a file?

program to extract a given word from a file


A program in c to copy text file?

File Operations in C are accomplished by the use of pointers.Pointers are use to point to a particular memory location.File are read and written by using file pointers.The Keyword FILE is used to declare a file pointer.The Complete Program for writing text to a file and saving it and copying it to a new location is given at http://c-madeeasy.blogspot.com/2011/07/program-in-c-to-write-data-to-file-and.html


How do you load a program in turbo c?

File/Open


You want a file handling c program?

yes


What are the file created after c file is save?

Having saved the source file (*.C), you can compile it into an object module (*.OBJ), then link an executable program (*.EXE)


What is multi file program in c?

The source code for the program is in many files verse being all in one file, I should think.


What is hader file in c?

The file which are represent at the top of any program or any presentaion is called hader


What is the default path for the folder where the active directory log file will be stored?

program file in c:\ drive


How can write a c program to store students record in a file?

Write a console based C++ program that reads student information from a text file, build an array of objects of type class StudentInfo,


Memory is empty but it says memory full in data c?

You have one or more errors in your program.


What action takes place when you save a file opened in an application program?

C