Previous Page
Next Page

fputs

Writes a string to a file

#include <stdio.h>
int fputs ( const char * restrict string , FILE * restrict fp  );

The fputs( ) function writes a string to the file specified by the FILE pointer argument. The string is written without the terminator character ('\0'). If successful, fputs( ) returns a value greater than or equal to zero. A return value of EOF indicates that an error occurred.

Example

See the examples at fclose( ) and fflush( ) in this chapter.

See Also

fgets( ), fputws( )


Previous Page
Next Page