void addpr(Product p[], int num_of_product);//在購物車里添加商品
void show(Product p[], int num_of_product);//列印商品資訊
void verify_password();
int show_mail(Customer s[], Product p[], int num_of_Mailing); //列印郵寄資訊
int show_report(Product p[], int num_of_product char *pr_ordinal );//列印訂單串列
int show_order(Product p[], int num_of_product);//顯示訂單發票資訊
int append_customer(Customer s[], int num_of_customer);//添加顧客資訊
int append_mailing(Mailing m[], int num_of__Mailing);//添加郵寄資訊
int append_product(Product p[], int num_of_product);//添加商品資訊
int show_report(product p[],int num_of_product, char *pr_ordinal)//列印訂單串列
{
int i;
for (i = 0; i < num_of_product; i++)
{
switch (s[i]) //查詢訂單完成情況并列印訂單資訊
{
case "已完成":
show_info(p, id, num_of_product);
break;
case "未付款":
show_info(p, id, num_of_product);
break;
case "未發貨":
show_info(p, id, num_of_product);
break;
}
}
return;
}
uj5u.com熱心網友回復:
int num_of_product 和 char *pr_ordinal 之間加個逗號,也就是引數之間用逗號分開。uj5u.com熱心網友回復:
1.檢查是否用了中文標點符號2. case "已完成": case 不支持這種寫法吧
uj5u.com熱心網友回復:
加","了case 也改成case 1了還是有這個報錯uj5u.com熱心網友回復:
product 大小寫也關注一下uj5u.com熱心網友回復:
你這.....switch case用的真牛啊。。。不知道該怎么說你了uj5u.com熱心網友回復:
int show_report(Product p[], int num_of_product char *pr_ordinal );
第二個引數和第三個直接是不是少一個逗號呢?
switch的引數只能是int,整形數,你用字串是不支持的。
建議樓主重新了解一下switch case的用法~
轉載請註明出處,本文鏈接:https://www.uj5u.com/houduan/24086.html
標籤:C語言
