围绕变量“输入”的堆栈已损坏(Stack around the variable 'input' was corrupted)
我刚开始使用C语言,但遇到了这个错误。 我试图在网上查找,但其他线程包含我不熟悉的ARRAY。
#include
int main(void){
char input;
printf("ASCII testing\n");
scanf( "%d", &input); //the error occurs here but would like to know the solution
printf("answer is : %c\n" , input);
system("pause");
return 0;
}
“运行时检查失败#2 - 围绕变量”输入“的堆栈已损坏。”
简单的指出将非常感激
//编辑
那么我想输入值“66”,这样结果将是B. scanf(“%c,&input)接受来自键盘的1次击键,所以这不是我正在寻找的。但尽管如此,谢谢你的回复
I just started my C language and I came to this error. I tried to look up online but other threads contain ARRAY which I am not familiarize with.
#include
int main(void){
char input;
printf("ASCII testing\n");