我有这个功能,它是一个菜单。编译后不断出现如下错误:error: comparison between pointer and integer [默认开启]。为什么会这样?
char choice;
printf ("Welcome to the Customer menu! \n");
printf ("Please select option from below\n");
printf ("a. Add customer\n");
printf ("b. Modify customer\n");
printf ("c. List customers\n");
printf ("d. Go back to main menu");
while ((gets(&choice)) != 'q')
{
if (choice == '\n')
continue;
switch (choice)
{
case 'a' : add_customer();
break;
case 'b' : printf ("products_main ()");
break;
case 'c' : printf ("orders_main ()");
break;
default : printf ("Invalid input. Please enter an option from the above menu\n");
continue;
}
printf ("END PROGRAM");
谢谢!!