Retro video games delivered to your door every month!
Click above to get retro games delivered to your door ever month!
X-Hacker.org- Microsoft C 6.0 - <b>fputs() write a string to stream</b> http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
 fputs()                 Write a String to Stream

 #include   <stdio.h>

 int        fputs(string,stream);
 char       *string;                     String to be output
 FILE       *stream;                     Pointer to FILE structure


    fputs() copies 'string' to the output 'stream' at the current
    position.  It does not copy the terminating null character ('\0').


    Returns:    If successful, a zero is returned; a non-zero value is
                returned on failure.

 Compatibility: MSC version 4.0 would return either EOF or the last
                character output, in the event of error; version 5.0 and
                later returns a non-zero value.

   -------------------------------- Example ---------------------------------

    The following statements open a file and write a string to it.

           #include <stdio.h>

           FILE *stream;

           main()
           {
               if ((stream = fopen("book.dat","a+")) != NULL) {
                   fputs("End of Chapter 10\n", stream);
               }
           }



See Also: fgets() gets() puts()

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