PUTS

Section: Linux Programmer's Manual (3)
Updated: 1993-04-04
Index

NAME

fputc, fputs, putc, putchar, puts - 输出字符和字符串

总览 (SYNOPSIS)

#include <stdio.h>

int fputc(int c, FILE *stream);
int fputs(const char *s, FILE *stream);
int putc(int c, FILE *stream);
int putchar(int c);
int puts(const char *s);

描述 (DESCRIPTION)

fputc() 把 字符 c 转换到 unsigned char 类型, 然后 从 stream 流 输出.

fputs() 把 字符串 sstream 流 输出, 但是 不输出 结尾处的 '\0'.

putc() 等于 fputc() , 只是 它 可能 以 宏 的 形式 实现, 并 多次 访问 stream 流.

putchar(c); 等于 putc(c,stdout).

puts()stdout 输出 字符串 s 和 一个 换行符 (newline).

这里 描述的 函数 可以 混合 使用, 也可以 结合 stdio 库中 其他的 输出函数 处理 同一个 输出流.

相应的 无锁函数(non-locking) 参见 unlocked_stdio(3).

返回值 (RETURN VALUE)

如果 操作 成功, fputc(), putc() putchar() 返回 把 字符 从 unsigned char 类型 转换来的 int 值, 否则 返回 EOF .

如果 操作 成功, puts()fputs() 返回 大于等于零的值, 否则 返回 EOF .

参考标准 (CONFORMING TO)

ANSI - C, POSIX.1

BUGS

建议 不要 混合 stdio 库的 输出函数 和 低层 write() 函数 对 输出流 对应 文件描述符 的 调用; 其 结果 没有 定义, 极可能 不是 你 需要的.

另见 (SEE ALSO)

write(2), ferror(3), fopen(3), fseek(3), fwrite(3), gets(3), scanf(3), unlocked_stdio(3)

[中文版维护人]

徐明 <xuming@users.sourceforge.net>

[中文版最新更新]

2004/09/10

《中国Linux论坛man手册页翻译计划》

http://cmpp.linuxforum.net


Index

NAME
总览 (SYNOPSIS)
描述 (DESCRIPTION)
返回值 (RETURN VALUE)
参考标准 (CONFORMING TO)
BUGS
另见 (SEE ALSO)
[中文版维护人]
[中文版最新更新]
《中国Linux论坛man手册页翻译计划》

This document was created by man2html, using the manual pages.
Time: 01:51:38 GMT, September 14, 2004