putc 中文man页面

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

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)  

#p#

NAME

fputc, fputs, putc, putchar, puts - output of characters and strings  

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() writes the character c, cast to an unsigned char, to stream.

fputs() writes the string s to stream, without its trailing '\0'.

putc() is equivalent to fputc() except that it may be implemented as a macro which evaluates stream more than once.

putchar(c); is equivalent to putc(c,stdout).

puts() writes the string s and a trailing newline to stdout.

Calls to the functions described here can be mixed with each other and with calls to other output functions from the stdio library for the same output stream.

For non-locking counterparts, see unlocked_stdio(3).  

RETURN VALUE

fputc(), putc() and putchar() return the character written as an unsigned char cast to an int or EOF on error.

puts() and fputs() return a non-negative number on success, or EOF on error.

CONFORMING TO

ANSI - C, POSIX.1  

BUGS

It is not advisable to mix calls to output functions from the stdio library with low - level calls to write() for the file descriptor associated with the same output stream; the results will be undefined and very probably not what you want.  

SEE ALSO

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

责任编辑:韩亚珊 来源: CMPP.net
相关推荐

2011-08-24 16:48:36

man中文man

2011-08-15 10:21:09

man中文man

2011-08-11 16:11:49

at中文man

2011-08-25 10:21:56

man.conf中文man

2011-08-11 15:03:21

ACCESS中文man

2011-08-16 10:59:16

pwconv中文man

2011-08-25 17:43:07

snprintf中文man

2011-08-19 18:30:52

ipc中文man

2011-08-15 13:53:19

stat中文man

2011-08-25 15:24:31

execlp中文man

2011-08-15 18:06:07

restore中文man

2011-08-24 17:26:35

reindex中文man

2011-08-15 15:45:04

xpdf中文man

2011-08-24 17:06:42

NOTIFY中文man

2011-08-15 14:42:28

uname中文man

2011-08-15 11:30:37

pwd中文man

2011-08-23 14:24:42

ping中文man

2011-08-15 11:01:45

2011-08-11 16:31:49

biff中文man

2011-08-25 17:15:16

printf中文man
点赞
收藏

51CTO技术栈公众号