【お知らせ】この部分は英語原文のみでの提供となります。何卒ご了承ください。
2.1.9.10 fputs
Contents
Description
This function copies string to the output stream at the current position.
Syntax
int fputs( const char * str, FILE * stream )
Parameters
- str
- Output string
- stream
- Pointer to FILE
Return
Returns a nonnegative value if it is successful. On an error, fputs returns EOF.
Examples
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 ); } }
Remark
See Also
Header to Include
origin.h