delorie.com/djgpp/doc/libc/libc_417.html   search  
libc.a reference

[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

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.

Portability

ANSI/ISO C C89; C99
POSIX 1003.2-1992; 1003.1-2001

Example

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


  webmaster     delorie software   privacy  
  Copyright © 2004     Updated Apr 2004