Museum

Home

Lab Overview

Retrotechnology Articles

Online Manuals

⇒ gets(3) — Purdue Xinu

Media Vault

Software Library

Restoration Projects

Artifacts Sought

Related Articles

getc(2)

puts(2)

scanf(3)

fread(3)

GETS(3)

NAME

gets, fgets − get a string from a device

SYNOPSIS

#include <io.h>

char ∗gets(s)
char ∗s;

char ∗fgets(dev, s, n)
intdev;
char ∗s;
intn;

DESCRIPTION

Gets reads a string into s from the standard input device, CONSOLE.  The string is terminated by a newline character, which is replaced in s by a null character.  Gets returns its argument. 

Fgets reads n−1 characters, or up to a newline character, whichever comes first, from device dev into the string s. The last character read into s is followed by a null character.  Fgets returns its second argument. 

SEE ALSO

getc(2), puts(2), scanf(3), fread(3),

DIAGNOSTICS

Gets and fgets return SYSERR if an error results. 

BUGS

Gets deletes a newline, fgets keeps it, all in the name of backward compatibility. 

December 01, 1986  —  Xinu Programmer’s Manual

Typewritten Software • bear@typewritten.org • Edmonds, WA 98026