getline

Section: Misc. Reference Manual Pages (1,local)
Index Return to Main Contents
 

NAME

getline - get a line of near-arbitrary length from a stream.  

SYNTAX

#include <stdio.h>

char *getline(stream)
FILE *stream;

 

DESCRIPTION

The getline routine reads up to a newline character from the stream into an internal cache of arbitrary size. The last character read is followed by a null character. The getline routine returns its first argument or NULL on end of file or error.

 

DIAGNOSTICS

If a line longer than available memory is read, the program exits with a message. This is expected to be a rare event.

 

SEE ALSO

ferror(3s), fread(3s), getc(3s), puts(3s), scanf(3s), fgets(3).

 

BUGS

Strictly dependant on the behavior of fgets: treats a ^D (eof) in mid-stream from a terminal as does fgets (ie, it disappears silently under Ultrix/Berzerkley)

Written by Dave (instakludge) Collier-Brown.


 

Index

NAME
SYNTAX
DESCRIPTION
DIAGNOSTICS
SEE ALSO
BUGS

This document was created by man2html, using the manual pages.
Time: 07:13:02 GMT, December 12, 2024