codescracker


c

C puts()



« Previous Function Next Function »


puts()

The puts() functions writes the string pointed to by str to the standard output device. The null terminator is translated to a newline.

puts() Syntax

#include<stdio.h>
int puts(const char *str);

The puts() returns a non-negative value if successful, otherwise returns EOF on failure

puts() Example

Following c program writes the string this is an example to the stdout

#include<stdio.h>
#include<conio.h>
#include<string.h>
void main()
{
	clrscr();
	char str[80];
	strcpy(str, "this is an example");
	puts(str);
	getch();
}

« Previous Function Next Function »



Tools
Calculator

Quick Links
Signup - Login - Give Online Test