Retro video games delivered to your door every month!
Click above to get retro games delivered to your door ever month!
X-Hacker.org- Watcom C Library Reference - <u>synopsis:</u> http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
Synopsis:
    #include <stdio.h>
    int fputs( const char *buf, FILE *fp );
    #include <stdio.h>
    #include <wchar.h>
    int fputws( const wchar_t *buf, FILE *fp );

Description:
    The fputs function writes the character string pointed to by buf to the
    output stream designated by fp.  The terminating null character is not
    written.

    The fputws function is identical to fputs except that it converts the
    wide character string specified by buf to a multibyte character string
    and writes it to the output stream.

Returns:
    The fputs function returns EOF if an error occurs otherwise, it returns
    a non-negative value.  The fputs function returns EOF if a write or
    encoding error occurs otherwise, it returns a non-negative value.  When
    an error has occurred,  errno contains a value indicating the type of
    error that has been detected.

Example:
    #include <stdio.h>

    void main()
      {
        FILE *fp;
        char buffer[80];

        fp = fopen( "file", "r" );
        if( fp != NULL ) {
          while( fgets( buffer, 80, fp ) != NULL )
            fputs( buffer, stdout );
          fclose( fp );
        }
      }

Classification:
    fputs is ANSI, fputws is ANSI

Systems:
     fputs - All, Netware

    fputws - All

See Also:
    fopen, fputc, fputchar, putc, putchar, puts, ferror

See Also: ferror

Online resources provided by: http://www.X-Hacker.org --- NG 2 HTML conversion by Dave Pearson