getchar()得到的是不是一个串??

qlj86314901 2008-11-05 06:49:48
RT
...全文
201 6 打赏 收藏 转发到动态 举报
写回复
用AI写文章
6 条回复
切换为时间正序
请发表友善的回复…
发表回复
luojc714 2008-11-05
  • 打赏
  • 举报
回复
函数的原型为
int getchar();
所以返回的是一个整型数。
kdy88120 2008-11-05
  • 打赏
  • 举报
回复
我见过一次是这样用的
char *p;
p=getchar();
fox000002 2008-11-05
  • 打赏
  • 举报
回复
返回字符对应的 int

int getchar ( void );

<cstdio>

Get character from stdin

Returns the next character from the standard input (stdin).
It is equivalent to getc with stdin as its argument.

Parameters
(none)

Return Value

The character read is returned as an int value.

If the End Of File is reached or a reading error happens, the function returns EOF
and the corresponding error or eof indicator is set. You can use either ferror or
feof to determine whether an error happened or the End-Of-File was reached.
Super.Jiju 2008-11-05
  • 打赏
  • 举报
回复
[Quote=引用 1 楼 xhs_lh04 的回复:]
是一个字符
[/Quote]
get char
xhs_lh04 2008-11-05
  • 打赏
  • 举报
回复
跟getc差不多
xhs_lh04 2008-11-05
  • 打赏
  • 举报
回复
是一个字符

65,211

社区成员

发帖
与我相关
我的任务
社区描述
C++ 语言相关问题讨论,技术干货分享,前沿动态等
c++ 技术论坛(原bbs)
社区管理员
  • C++ 语言社区
  • encoderlee
  • paschen
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
  1. 请不要发布与C++技术无关的贴子
  2. 请不要发布与技术无关的招聘、广告的帖子
  3. 请尽可能的描述清楚你的问题,如果涉及到代码请尽可能的格式化一下

试试用AI创作助手写篇文章吧