DOC HOME SITE MAP MAN PAGES GNU INFO SEARCH PRINT BOOK
 

puts(3S)


puts, fputs -- put a string on a stream

Synopsis

   #include <stdio.h>
   

int puts (const char *s);

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

Description

puts writes the string pointed to by s, followed by a new-line character, to the standard output stream stdout [see intro(3)].

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

Neither function writes the terminating null character.

Errors

On success both routines return the number of characters written; otherwise they return EOF.

The functions puts and fputs fail if either the named stream is unbuffered or its buffer needed to be flushed and an attempt was made to write at or beyond the offset maximum.

References

abort(3C), exit(2), fclose(3S), ferror(3S), fopen(3S), fprintf(3S), fread(3S), intro(3), Intro(3S), lseek(2), putc(3S), write(2)

Notices

puts appends a new-line character while fputs does not.
© 2004 The SCO Group, Inc. All rights reserved.
UnixWare 7 Release 7.1.4 - 25 April 2004