【发布时间】:2014-11-10 09:41:21
【问题描述】:
#include <stdio.h>
#include <conio.h>
#include <stdlib.h>
int main()
{
int ActChoice=0;
//do
//{
printf("What Activity were you doing?");
printf("\n1. Running" );
printf("\n2. Swimming");
printf("\n3. Cycling" );
scanf("\n%d",ActChoice);
/*if(ActChoice == 1)
{
RunEdit();
}
else if(ActChoice == 2)
{
SwimEdit();
}
else if(ActChoice == 3)
{
CyclEdit();
}*/
//}
// while(1==1);
getch();
}
这里我有一段非常简单的代码,用于选择所需的功能,但是,在运行该程序时,我输入“ActChoice”后它会崩溃。
我不知道这是我的代码中的错误,还是更下方的代码,但它似乎在扫描时中断了。
编辑:我忘了 & ,我实际上是弱智
【问题讨论】: