Call menu function in another function

后端 未结 3 2017
春和景丽
春和景丽 2020-12-22 11:22

I\'m trying to call menu function in the main function and let it prompt until the user decides to quit, but seems like it\'s not giving me response.. I\'m new at this websi

3条回答
  •  自闭症患者
    2020-12-22 12:05

    there are two problem in your code.

    1. menu() function returns int and you are matching int with char in switch case case '1': it should be case 1:

    2. replace below line

    scanf("%c%c", &yesno,&c); with scanf("%c%c", &c,&yesno);

    hope this help you.

提交回复
热议问题