Which one of the following is NOT a standard C library function related to file operations?
IBM aptitude question, verified with a worked answer. Free to practise - no sign-up.
Which one of the following is NOT a standard C library function related to file operations?
Show answer & explanation
Answer: D. fftell
fftell is not a standard C library function. The correct function for getting the current file position is ftell(), not fftell(). The prefix 'ff' does not correspond to any standard C file operation. fopen, fclose, and freopen are all legitimate standard C library functions for file handling.
Step-by-step Derivation:
Review standard C library file operation functions:
- fopen(): Opens a file and returns a FILE pointer
- fclose(): Closes a file stream
- freopen(): Reopens a file stream or associates it with a different file
- fftell(): NOT a standard function (typo/non-existent)
- ftell(): The actual standard function that returns current file position
The question asks which is NOT a standard function. Only 'fftell' is non-standard; the others are all valid C standard library functions.