.TH puts() "" "" "STDIO Function (libc)"
.PC "Write string onto standard output"
\fB#include <stdio.h>\fR
\fBint puts(\fIstring\fB)\fR
\fBchar *\fIstring\fR
.PP
.B puts()
appends a newline character onto the string to which
.I string
points, and writes the result onto the standard output.
If all goes well, it returns a nonnegative value
(not necessarily \-1); if an error occurs, it returns EOF.
.SH Example
The following uses
.B puts()
to write a string on the screen.
.DM
#include <stdio.h>
.sp \n(pDu
main()
{
	puts("This is a string.");
}
.DE
.SH "See Also"
.Xr "fputs()," fputs()
.Xr "libc" libc
.br
\*(AS, \(sc7.9.7.10
.br
\*(PX Standard, \(sc8.1
.SH Notes
For historical reasons,
.B fputs()
outputs the string unchanged, whereas
.B puts()
appends a newline character.
