标题:本人发现c语言中关于scanf()函数一个怪异的问题?
取消只看楼主
hengshan
Rank: 1
等 级:新手上路
帖 子:6
专家分:0
注 册:2005-4-15
 问题点数:0 回复次数:0 
本人发现c语言中关于scanf()函数一个怪异的问题?

#include <stdio.h> int main() { char s[20]; char temp; printf("input the temp \n"); printf("q or t? "); scanf("%c",&temp); while(1) { printf("input the s\n"); scanf("%s",s); printf("%s\n",s);

printf("q or t? "); scanf("%c",&temp); if(temp == 'q') break; } return 0; } 低二条scanf("%c",&temp);语句总是的不到执行,怎么回事啊,可是如果换成c++下的cin就好了

搜索更多相关主题的帖子: c语言 scanf 函数 怪异 
2005-05-24 11:13



参与讨论请移步原网站贴子:https://bbs.bccn.net/thread-19168-1-1.html




关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.607925 second(s), 8 queries.
Copyright©2004-2025, BCCN.NET, All Rights Reserved