Format
#include <stdio.h>
int puts(const char *string);
Language Level: ANSI
Threadsafe: Yes.
Description
The puts() function writes the given string to the standard output stream stdout; it also appends a new-line character to the output. The ending null character is not written.
Return Value
The puts() function returns EOF if an error occurs. A nonnegative return value indicates that no error has occurred.
The value of errno may be set to:
Example that uses puts()
This example writes Hello World to stdout.
#include <stdio.h>
int main(void)
{
if ( puts("Hello World") == EOF )
printf( "Error in puts\n" );
}
/************************ Expected output: *********************
Hello World
*/
Related Information