Chapter Contents

Previous

Next
puts

puts



Write a String to the Standard Output Stream

Portability: ISO/ANSI C conforming, UNIX compatible


SYNOPSIS
DESCRIPTION
RETURN VALUE
EXAMPLE
RELATED FUNCTIONS
SEE ALSO


SYNOPSIS

#include <stdio.h>

int puts(const char *str);


DESCRIPTION

puts(str) is equivalent to fputs(str, stdout) , except that a new-line character is written to stdout after the last character of str .


RETURN VALUE

puts returns EOF if an error occurs. Otherwise, puts returns a nonzero value.


EXAMPLE

This example writes the following two lines to stdout

#include <stdio.h>

main()
{
   puts("The first line of example output.");
   fputs("The second line of example output ",stdout);
   puts("written in two pieces.");
}


RELATED FUNCTIONS

afwrite , fputs


SEE ALSO


Chapter Contents

Previous

Next

Top of Page

Copyright © 2001 by SAS Institute Inc., Cary, NC, USA. All rights reserved.