Your Browser is not longer supported

Please use Google Chrome, Mozilla Firefox or Microsoft Edge to view the page correctly
Loading...

{{viewport.spaceProperty.prod}}

puts - put string on standard output

&pagelevel(4)&pagelevel

Syntax

#include <stdio.h>

int puts(const char *s); 

Description

puts() writes the string pointed to by s, followed by a newline character, to the standard output stream stdout. The terminating null byte is not written.

The structure components st_ctime and st_mtime of the file are marked for changing between successful execution of puts() and the next successful completion of a call to fflush() or fclose() for the same data stream or a call to exit() or abort() (see sys/stat.h).

Return val.

Non-negative number


if successful.

EOF

if an error occurs. The error indicator for the stream is set, and errno is set to indicate the error.

Errors

See fputc().

Notes

The puts() function appends a newline character, while fputs() does not.

The terminating null byte of s is not output.

BS2000

The following applies in the case of text files with SAM access mode and variable record length for which a maximum record length is also specified: When the specification split=no was entered for fopen(), records which are longer than the maximum record length are truncated to the maximum record length when they are written. By default or with the specification split=yes, these records are split into multiple records. If a record has precisely the maximum record length, a record of the length zero is written after it. (End)

The program environment determines whether puts() is executed for a BS2000 or POSIX file.

For further information on output to text files and on converting control characters for white space (\n, \t, etc.), see section “White-space characters”.

See also

fputs(), fopen(), putc(), stdio, stdio.h.