www.delorie.com/djgpp/doc/libc-2.01/libc_348.html   search  
Go to the first, previous, next, last section, table of contents.


gets

Syntax

#include <stdio.h>

char *gets(char *buffer);

Description

Reads characters from stdin, storing them in buffer, until either end of file or a newline is encountered. If any characters were stored, the buffer is then NULL terminated and its address is returned, else NULL is returned.

Return Value

The address of the buffer, or NULL.

Example

char buf[1000];
while (gets(buf))
  puts(buf);


Go to the first, previous, next, last section, table of contents.

  prev next   webmaster     delorie software   privacy  
  Copyright © 1997     Updated Apr 1997