puts, fputs
Purpose
Writes a string to a stream.
Library
Standard I/O Library (libc.a)
Syntax
#include <stdio.h>
int puts (s) int fputs (s, stream)
char *s; char *s;
FILE *stream;
Description
The puts subroutine writes the null-terminated string
pointed to by the s parameter, followed by a new-line
character, to the standard output stream, stdout.
The fputs subroutine writes the null-terminated string
pointed to by the s parameter to the output stream speci-
fied by the stream parameter. The fputs subroutine does
not append a new-line character.
Neither subroutine writes the terminating null character.
Return Value
Upon successful completion, the puts and fputs subrou-
tines return the number of characters written. Both sub-
routines return EOF on an error. This happens if the
routines try to write on a file that has not been opened
for writing.
Related Information
In this book: "feof, ferror, clearerr, fileno," "fopen,
freopen, fdopen," "fread, fwrite," "gets, fgets,"
"printf, fprintf, sprintf, NLprintf, NLfprintf,
NLsprintf," "putc, putchar, fputc, putw," and "standard
i/o library."