typedef int MHF;typedef struct LNode{ char quming[20]; char zuozhe[20]; char geshou[20]; MHF nian; MHF yue; MHF ri; struct LNode *next;}LNode, *LinkList;int listinsert(LinkList &L, int i, char *quming, char *zuozhe, char *geshou, MHF &nian, MHF &yue, MHF &ri){ if (i < 1) return 0; int j = 0; LinkList p = L,s; while ((j < i - 1) && p != NULL) { p = p->next; j++; } if (p == NULL) return 0; else { s = new LNode; if (s == NULL) { cout << "結(jié)點分配失敗\n"; return 0; } s->quming = quming; cout << quming << endl; cout << s->quming << endl; s->geshou = geshou; cout << geshou << endl; cout << s->geshou << endl; s->zuozhe = zuozhe; cout << zuozhe << endl; cout << s->zuozhe << endl; s->nian = nian; s->yue = yue; s->ri = ri; s->next = p->next; p->next = s; return 1; }}s報錯,說表達式必須為可修改的左值,這是為什么???
表達式必須為可修改的左值。
Ma峰
2016-11-20 19:55:10