DOC HOME SITE MAP MAN PAGES GNU INFO SEARCH PRINT BOOK
 

puts(S-osr5)


puts, fputs -- put a string on a stream

Syntax

cc . . . -lc

#include <stdio.h>

int puts (const char *s);

int fputs (const char *s, FILE *stream);

Description

puts- writes null-terminated string to standard output stream

fputs- writes nul-terminated string to named output stream

The puts function writes the null-terminated string pointed to by s, followed by a new-line character, to the standard output stream stdout.

fputs writes the null-terminated string pointed to by s to the named output stream.

Neither function writes the terminating null character.

Diagnostics

Both routines return EOF on error, which occurs if the routines try to write to a file that has not been opened for writing.

Notes

The puts function appends a new-line character while fputs does not.

See also

ferror(S-osr5), fopen(S-osr5), fread(S-osr5), printf(S-osr5), putc(S-osr5), stdio(S-osr5)

Standards conformance

fputs and puts are conformant with:

X/Open Portability Guide, Issue 3, 1989 ;
ANSI X3.159-1989 Programming Language -- C ;
Intel386 Binary Compatibility Specification, Edition 2 (iBCSe2) ;
IEEE POSIX Std 1003.1-1990 System Application Program Interface (API) [C Language] (ISO/IEC 9945-1) ;
and NIST FIPS 151-1 .


© 2005 The SCO Group, Inc. All rights reserved.
SCO OpenServer Release 6.0.0 -- 02 June 2005