totn C Functions

C Language: puts function
(Write String)

In the C Programming Language, the puts function writes a string (and then a new-line characters) to the stdout stream.

Syntax

The syntax for the puts function in the C Language is:

int puts(const char *s);

Parameters or Arguments

s
The string to write to stdout.

Returns

The puts function returns a nonnegative value if successful. If an error occurs trying to write to stdout, the puts function will return EOF.

Required Header

In the C Language, the required header for the puts function is:

#include <stdio.h>

Applies To

In the C Language, the puts function can be used in the following versions:

  • ANSI/ISO 9899-1990

Similar Functions

Other C functions that are similar to the puts function:

See Also

Other C functions that are noteworthy when dealing with the puts function: