我正在使用 C 并且在运行程序时收到此错误。当我输入字符“e”关闭程序时出现错误。请帮我!!!谢谢。:)
int main () {
while (true){
HANDLE consoleHandle = GetStdHandle(STD_OUTPUT_HANDLE);
char wanted;
int c;
printf("Enter What You Want...\n");
printf("f for flower\n");
printf("m for mushroom\n");
printf("b for box\n");
printf("h for mario\n");
printf("e to close\n");
scanf("%s", &wanted);
if (wanted=='f'){
/*some codes here*/
}
else if (wanted=='m'){
/*some codes here*/
}
else if (wanted=='b'){
/*some code here*/
}
else if (wanted=='h'){
/*some codes here*/
}
else if (wanted=='e'){
printf("Bye.\n");
break;
}
else {
printf("It Was'n a Possible Input. Try Again...\n");
}
}
return 0;
}