puts()
QNX SDP8.0C Library ReferenceAPIDeveloper
Write a string to stdout
Synopsis:
#include <stdio.h>
int puts( const char *buf );
Arguments:
- buf
 - A pointer to the zero-terminated string that you want to write.
 
Library:
libc
Use the -l c option to qcc to link against this library. This library is usually included automatically.
Description:
The puts() function writes the character string pointed to by buf to the stdout stream, and appends a newline character to the output. The terminating NUL character of buf isn't written.
Returns:
A nonnegative value for success, or EOF if an error occurs (errno is set).
Examples:
#include <stdio.h>
#include <stdlib.h>
int main( void )
{
    FILE *fp;
    char buffer[80];
    fp = freopen( "file", "r", stdin );
    while( gets( buffer ) != NULL ) {
        puts( buffer );
    }
    fclose( fp );
    
    return EXIT_SUCCESS;
}
Classification:
| Safety: | |
|---|---|
| Cancellation point | Yes | 
| Signal handler | No | 
| Thread | Yes | 
Page updated: 
