小编Sha*_*cck的帖子

无法使Switch-Case语句在C <stdio.h>中工作

任何人都可以告诉我为什么我不能让这个菜单让我做出选择?它跳过让我选择正确的"错误选择".在此先感谢您的帮助,我一定会感谢您的亲自.

printf("Welcome to the Inventroy Control System");
printf("\nPlease make a selection");
printf("\n\n\ta) Display Inventory");

printf("\n\tb) Add New Items");
printf("\n\tg) Exit");
printf("\nSelect what you would like to do");
printf("\nOption Chosen: ");

fflush(stdin);
scanf("%c", &input);

input = toupper(input);

switch(input)

{

case 'A':
{
    funa(j,a);
    break;
}
case 'B':
{
    j = funb(amount,a);
    break;
}
case 'G':
{
    fung();
    break;
}
default:
{
    printf("\nWrong Selection");
}
}
Run Code Online (Sandbox Code Playgroud)

c stdio switch-statement

-1
推荐指数
1
解决办法
108
查看次数

标签 统计

c ×1

stdio ×1

switch-statement ×1