Table of Contents
Previous topic Next topic
C COMPILER LIBRARY FUNCTION REFERENCE->Detailed Descriptions->fgets()
int fgets(char* string, int n, FILE* stream); Read characters from stream
|string||Pointer to char array pointer to receive characters|
|n||Number of characters to read|
|stream||Pointer to file structure|
This function reads at most the next n-1 characters from stream into the array pointed to by string. Input stops if a newline character is encountered. The newline character is included in the array and the array is terminated by '\0'. stdin is the only input stream supported.
The function returns string or NULL if an error occurred.