A program uses fprintf() to write 1000 integers to a file but doesn't call fclose(). What could happen?
A binary file contains 500 structures of size 32 bytes each. To skip the first 10 structures and read the 11th one, which fseek() call is correct?
Which of the following modes will truncate an existing file?
A program reads a CSV file with fgets() storing data in a 256-byte buffer. Some lines exceed 255 characters. How should this be handled?
What does fflush(fp) do when fp is a file pointer?
Advertisement
In a file opened in "a+" mode, where does the file pointer initially point?
Which mode allows both reading and appending without truncating existing content?
What does the function ftell(fp) return in file handling?
Which of the following correctly reads a string from file with size limit?
A program needs to update specific bytes in the middle of a file without affecting other data. Which approach is most suitable?
What is the difference between 'rb' and 'r' modes when opening a file?
In a file opened with 'rb+' mode, what operations can be performed?
A program reads structured data: fread(ptr, sizeof(struct), count, fp). If fread() returns a value less than 'count', what could be the reason?
In competitive exam file handling questions, if fseek() is called with SEEK_CUR, what does it indicate?
A C program must securely close a file and handle potential errors. What is the best approach?
A program needs to append 500 integers to an existing binary file. Which combination is correct?
What happens if you call fclose() on an already closed file pointer?
A program reads struct records using fread(). After reading 100 records of 64 bytes each, what is the total bytes read if successful?
Which statement correctly counts non-comment lines in a text file?
In a program processing a CSV file, what is the most robust approach for reading variable-length lines?