Share this page

# fgets

Example: fgets | Input-Output Functions

Reads a string from a file.

    char *fgets( char *string, int maxchar, FILE *file_pointer);

string | The string to retrieve.
maxchar | The maximum number of characters to retrieve.
file_pointer | A pointer to a file.

## Return Values

Upon success, it returns the read string. If the End Of File is reached or if a reading error occurred, it returns a null pointer.

Tips to improve your search results... VuGen Function Reference Version 25.1-25.3 Function Reference 25.1-25.3 All View Local Help Center View Online Help Center Version: