Guardian C Library Calls Reference Manual

fputs
3-56 128833Guardian TNS C Library Calls Reference Manual
Reference to Library Calls
fputs
The fputs function writes a string to a file opened for ANSI I/O.
str_ptr
points to an array of characters.
stream
denotes a file opened for ANSI I/O.
Return Value
is the value EOF if an error occurs.
Usage Guidelines
The fputs function writes characters from a string to a file until it encounters a null
character. It does not write a newline character following the string.
Example
In this example, the fputs function writes “Hello” to $a.b.c:
#include <stdioh>
FILE *fp;
char *sp;
int status;
fp = fopen("$a.b.c", "w");
sp = "Hello";
status = fputs(sp, fp);
#include <stdioh>
int fputs(const char *str_ptr, FILE *stream);