Museum

Home

Lab Overview

Retrotechnology Articles

⇒ Online Manual

Media Vault

Software Library

Restoration Projects

Artifacts Sought

Related Articles

ferror(3)

fopen(3)

fread(3)

printf(3)

putc(3)

stdio(3)



  puts(3)                             CLIX                             puts(3)



  NAME

    puts, fputs - Puts a string on a stream

  LIBRARY

    Standard C Library (libc.a)

  SYNOPSIS

    #include <stdio.h>

    int puts(
      char *string );

    int fputs(
      char *string ,
      FILE *stream );

  PARAMETERS

    string   A character string

    stream   A stream

  DESCRIPTION

    The puts() function writes the null-terminated string pointed to by
    string,followed by a newline character, to stdout.

    The fputs() writes the null-terminated string pointed to by string to the
    named output stream.

    Neither function writes the terminating null character.

  EXAMPLES

    1.  To display a string to stdout:

        char *string = "ERROR";
        puts(string);


    2.  To write a string to a file:

        FILE *outfile; /* You must make sure this file exists! */
        char *text = "A long string of stuff."
        fputs(text, outfile);


  NOTES



  2/94 - Intergraph Corporation                                              1






  puts(3)                             CLIX                             puts(3)



    The puts() function appends a newline character while fputs() does not.

  RETURN VALUES

    Both functions return EOF on error.  This will happen if the functions try
    to write to a file that has not been opened for writing.

  RELATED INFORMATION

    Functions:  ferror(3), fopen(3), fread(3), printf(3), putc(3), stdio(3)












































  2                                              Intergraph Corporation - 2/94




Typewritten Software • bear@typewritten.org • Edmonds, WA 98026