| Name | Description | Notes | Source | Availability | |||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
fputs() |
Output line of characters | (·) | <stdio.h> |
C89 | C90 | C95 | C99 | C11 | |||
fputws() |
Output line of wide characters | (·) | <wchar.h> |
C95 | C99 | C11 | |||||
puts() |
Output line of characters to standard output | (·) | <stdio.h> |
C89 | C90 | C95 | C99 | C11 | |||
#include<stdio.h>int fputs(const char *s, FILE *str); int puts(const char *s); #include<wchar.h>int fputws(const wchar_t *s, FILE *str);
fputs,
puts
and fputws
write a null-terminated string s to a
stream, excluding
the null character. fputs
and puts
write to a byte-oriented stream, and fputws
writes to a wide-oriented stream. fputs
and fputws
write to str, while puts
writes to stdout, and appends a newline
character.
The functions return EOF if a write error
occurs. fputws
also fails if there's an encoding error. Otherwise,
the functions return a non-negative value.