devxlogo

Tip Bank

Repositioning a File Pointer

The fseek() function provides random file access. It’s declared in as follows: int fseek(FILE *fstream, int offset, int whence); The function sets the file pointer associated with fstream to a

Invoking Overloaded Operators Explicitly

The overloaded operator mechanism is “syntactic sugar” for ordinary function calls. You can always use the explicit name of an overloaded operator function to resolve ambiguities or document your intention.

Getting the Current File Position

The standard function ftell() reports the current file pointer position. The file pointer is a numeric value that represents the current position in the file in the form of offset