Puts a string to the stream.
Include
<stdio.h>
Prototype
int fputs(const char *s, FILE *stream);
Arguments
s
|
string to be written |
stream
|
pointer to the open stream |
Return Value
Returns a non-negative value if successful; otherwise, returns EOF
.
Remarks
The function writes characters to the output stream up to but not including the null character.
Example
#include <stdio.h> /* for fputs, stdout */
int main(void)
{
char buf[] = "This is text\n";
fputs(buf,stdout);
fputs("|",stdout);
}
Example Output
This is text
|