up: programming - C - File I/O  
programming - C - function fgetsWhat links here?

Syntax

char *fgets(char *str, int num, FILE *stream);


Get string from stream



Reads characters from stream and stores them as a C string into str until (num-1) characters have been read or either a newline or a the End-of-File is reached, whichever comes first. A newline character makes fgets stop reading, but it is considered a valid character and therefore it is included in the string copied to str. A null character is automatically appended in str after the characters read to signal the end of the C string.



Parameters



Return Value

On success, the function returns the same str parameter.

If the End-of-File is encountered and no characters have been read, the contents of str remain unchanged and a null pointer is returned.

If an error occurs, a null pointer is returned.

Use either ferror or feof to check whether an error happened or the End-of-File was reached.
programming - C - function fgets
programming:windows:Button Notification Messages
programming - algorithms - graph drawing calculating the scaling factors
programming - C - function fwrite
programming - windows - CreateWindow
programming - C - function islower
programming - C - function fstat
programming - C - function fread
programming:windows:GetWindowLong
programming - C - function strncat
programming - C - function iscntrl
programming - C - function mktime
filename:programming - C - function fgets
filename:programming%20%2D%20C%20%2D%20function%20fgets
last edit:December 18 2012 19:05:48 (4651 days ago)
ct = 1757738780.000000 = September 13 2025 00:46:20
ft = 1355875548.000000 = December 18 2012 19:05:48
dt = 401863232.000000