gets


Read character string from SFR

[Classification]

Standard library

[Syntax]

#include <stdio.h>

char __near *__far gets(char __near *s);

char __far *__far _COM_gets_f(char __far *s);

[Return value]

s is returned.

If the end of a file is detected but not a single character has been read into the array, the contents of the array are left without change and the null pointer is returned.

[Description]

This function reads a character string from SFR using the getchar function and stores the read data into the string indicated by s.

When the end of the file is detected or when a new-line character is read, reading of characters is terminated, the read new-line character is discarded, and finally a null character is written immediately after the character that was last stored in the array.