记录详情

Compile Error

foo.cc:79:10: error: expected ';' after class definition
   79 |         }void Add(PolyList &L,PolyList &ans)
      |          ^
      |          ;
foo.cc: In member function 'void PolyList::Insert(Node*)':
foo.cc:46:20: error: 'p' was not declared in this scope
   46 |                 if(p!=NULL && p->data.index==newp->data.index  )
      |                    ^
foo.cc:56:40: error: type '<type error>' argument given to 'delete', expected pointer
   56 |                                 delete p;
      |                                        ^
foo.cc: In function 'void Add(PolyList&, PolyList&)':
foo.cc:81:26: error: 'head' was not declared in this scope
   81 |                 Node *p1=head;Node *p2=L.head;
      |                          ^~~~
foo.cc:81:42: error: 'Node* PolyList::head' is private within this context
   81 |                 Node *p1=head;Node *p2=L.head;
      |                                          ^~~~
foo.cc:26:15: note: declared private here
   26 |         Node *head;
      |               ^~~~
foo.cc:89:45: error: 'Node* PolyList::head' is private within this context
   89 |                                         ans.head=p3=new Node(p1->data.coef,p1->data.index);
      |                                             ^~~~
foo.cc:26:15: note: declared private here
   26 |         Node *head;
      |               ^~~~
foo.cc:110:53: error: 'Node* PolyList::head' is private within this context
  110 |                                                 ans.head=p3=new Node(p1->data.coef,p1->data.index);
      |                                                     ^~~~
foo.cc:26:15: note: declared private here
   26 |         Node *head;
      |               ^~~~
foo.cc:125:45: error: 'Node* PolyList::head' is private within this context
  125 |                                         ans.head=p3=new Node(p2->data.coef,p2->data.index);
      |                                             ^~~~
foo.cc:26:15: note: declared private here
   26 |         Node *head;
      |               ^~~~
foo.cc: In function 'void Output()':
foo.cc:150:29: error: 'head' was not declared in this scope
  150 |                 for(Node *p=head;p!=NULL;p=p->next)
      |                             ^~~~
foo.cc: At global scope:
foo.cc:153:1: error: expected declaration before '}' token
  153 | };
      | ^
foo.cc: In function 'int main()':
foo.cc:161:12: error: 'class PolyList' has no member named 'Add'
  161 |         L1.Add(L2,L3);
      |            ^~~
foo.cc:162:12: error: 'class PolyList' has no member named 'Output'
  162 |         L3.Output();
      |            ^~~~~~
[Hydro](https://hydro.ac)提供评测服务

信息

递交者
类型
自测
题目
DS1-1 一元多项式的运算
语言
C++
递交时间
2022-10-08 19:30:44
评测时间
2022-10-08 19:30:44
评测机
分数
0
总耗时
0ms
峰值内存
0 Bytes