标题:一个简单的问题想请教~
取消只看楼主
hexianqi1994
Rank: 1
等 级:新手上路
帖 子:50
专家分:0
注 册:2011-8-3
结帖率:86.96%
已结贴  问题点数:5 回复次数:1 
一个简单的问题想请教~
请看这一段代码,我想问是不是这个while循环是不是每到要判断循环条件时就要执行一次getchar函数,如果是的话就没必要蓝色这一段,如果不是的话,那第一次循环式是怎样获取一个ch值.
while(ch=getchar()!='n')
{
    for(i=0;i<CSIZE;i++)
    {
        printf("please enter the frist name and last name:");
        scanf("%s%s",msg[i].std_name.first,msg[i].std_name.last);
        printf("now please enter third dian of text:");
        scanf("%lf%lf%lf",&msg[i].dian[0],&msg[i].dian[1],&msg[i].dian[2]);
    }
    chuli(msg);
    printf("do you want to start\n");
    ch=getchar();
搜索更多相关主题的帖子: please please 
2011-08-25 14:49
hexianqi1994
Rank: 1
等 级:新手上路
帖 子:50
专家分:0
注 册:2011-8-3
得分:0 
我只想知道每一次循环判断条件的时候程序会不会调用getchar()而已
while(ch=getchar()!='n')
只需说是,或否还有原因就行
2011-08-25 16:06



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




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

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