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-15 10:21:09

man中文man

2011-08-24 16:48:36

man中文man

2011-08-11 16:11:49

at中文man

2011-08-25 10:21:56

man.conf中文man

2011-08-12 14:58:05

killall中文man

2011-07-15 16:58:36

ac中文man

2011-08-15 11:10:48

more中文man

2011-08-25 17:03:51

pclose中文man

2011-08-15 14:10:37

tar中文man

2011-08-16 10:42:30

rmmod中文man

2011-08-11 17:46:02

chmod中文man

2011-08-18 13:57:38

acct中文man

2011-08-23 17:49:36

zdump中文man

2011-08-15 15:10:49

wall中文man

2011-08-12 13:26:56

groff中文man

2011-08-25 11:39:13

tzfile中文man

2011-08-23 15:22:52

rootflags中文man

2011-08-23 15:06:03

quotastats中文man

2011-08-15 17:35:50

ar中文man

2011-08-25 09:07:16

suffixes中文man
点赞
收藏

51CTO技术栈公众号