fputs(), puts() - output a line to a stream
#include <stdio.h>
int fputs (const char *str, FILE *stream)
int puts (const char *str)
The function fputs(3) writes the string pointed to by
str to the stream pointed to by stream.
The function puts(3) writes the string str and a
terminating newline character, to the stream stdout.
The fputs(3) function returns 0 on success and EOF on
error; puts(3) returns a nonnegative integer on success
and EOF on error.
fputs(3) and puts(3) can fail and set errno to the
following values:
- [EBADF]
- The stream is not a writable stream.
- [EPIPE]
- An attempt is made to write to a pipe that is not open for
reading by any process.
- [EFBIG]
- An attempt was made to write a file that exceeds the process's
file size limit or the maximum file size.
- [EFAULT]
- Part of the data to be written to the file points outside the
process's allocated address space.
- [EINVAL]
- The pointer associated with stream was negative.
- [ENOSPC]
- There is no free space remaining on the file system containing
the file.
- [EIO]
- An I/O error occurred while reading from or writing to the file
system.
- [EAGAIN]
- The file was marked for non-blocking I/O, and no data could be
written immediately.
SEE ALSO
putc(3)
ferror(3)