puts - C stdio.h

C examples for stdio.h:puts

Type

function

From


<cstdio>
<stdio.h>

Description

Write string to stdout

Prototype

int puts ( const char * str );

Parameters

ParameterDescription
str C string to be printed.

Return Value

On success, a non-negative value is returned.

On error, the function returns EOF and sets the error indicator (ferror).

Demo Code


#include <stdio.h>

int main ()//from w  w  w.  j ava  2  s .c o  m
{
  char string [] = "Hello world!";
  puts (string);
}

Related Tutorials