我有這個功能,它是一個菜單。編譯後,以下錯誤不斷顯示:錯誤:指針和整數之間的比較[缺省情況下啓用]。爲什麼發生這種情況?菜單功能錯誤:指針和整數之間的比較[默認啓用]
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");
謝謝!
順便說一句,你爲什麼不閱讀你嘗試使用的函數的文檔? – 2012-12-20 20:49:56