puts function(Write String) in C Language – example and detail

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


The syntax for the places characteristic in the C Language is:

int puts(const char *s);

Parameters or Arguments


The string to write to stdout.


The puts function returns a nonnegative price 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 places function is:

#include <stdio.h>

Applies To

In the C Language, the places characteristic can be used in the following versions:

ANSI/ISO 9899-1990

Similar Functions

Other C functions that are comparable to the places function:

fputs function <stdio.h>

See Also

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

gets function <stdio.h>

fgets function <stdio.h>