fputs

Description

Writes a string to a stream.

#include <stdio.h>

int fputs( const char *string, FILE *stream );

string String to be output  
stream Pointer to FILE structure  

Remarks

The fputs function copies string to the output stream at the current position. The terminating null character ('\0') is not copied.

Return Value

The fputs function returns a nonnegative value if it is successful. If an error occurs, it returns EOF.

Compatibility

Standards:ANSI, UNIX

16-Bit:DOS, QWIN, WIN, WIN DLL

32-Bit:DOS32X

See Also

fgets, gets, puts

Example

/* FPUTS.C: This program uses fputs to write a single line to the

* stdout stream.

*/

#include <stdio.h>

void main( void )

{

fputs( "Hello world from fputs.\n", stdout );

}

Output

Hello world from fputs.