puts 中文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-25 15:09:38

clearerr中文man

2011-08-25 15:19:39

dirname中文man

2011-08-25 15:21:53

execl中文man

2011-08-25 16:28:50

fread中文man

2011-08-25 16:52:54

getchar中文man

2011-08-25 17:27:58

rewind中文man

2011-08-25 18:41:31

vprintf中文man

2011-08-23 10:03:40

useradd中文man

2011-08-23 10:29:02

chpasswd中文man

2011-08-23 10:34:22

convertquot中文man

2011-08-23 15:39:34

rpmbuild中文man

2011-08-23 18:00:21

LDP中文man

2011-08-25 09:40:49

UPDATE中文man

2011-08-24 15:11:15

explain中文man

2011-08-24 15:29:06

grant中文man

2011-08-24 15:48:38

INSERT中文man
点赞
收藏

51CTO技术栈公众号