This function copies string to the output stream at the current position.
int fputs( const char * str, FILE * stream )
Returns a nonnegative value if it is successful. On an error, fputs returns EOF.
EX1
//The following example use fputs to write a single line to the file fputs.out void test_fputs() { FILE *stream; // Open for write stream = fopen( "fputs.out", "w+" ); if( stream == NULL ) printf( "The file 'data' was not opened\n" ); else { fputs( "Hello world from fputs.\n", stream ); // Close stream fclose( stream ); } }
fgets
origin.h