puts Function

Put a string to stdout.

Include

<stdio.h>

Prototype

int puts(const char *s);

Argument

s
string to be written

Return Value

Returns a non-negative value if successful; otherwise, returns EOF.

Remarks

The function writes characters to the stream stdout. A newline character is appended. The terminating null character is not written to the stream.

Example

#include <stdio.h>

int main(void)
{
  char buf[] = "This is text\n";

  puts(buf);
  puts("|");
}

Example Output

This is text

|