记录详情

Compile Error

foo.cc: In function ‘int main()’:
foo.cc:104:15: error: ‘int LinkList::Count’ is private within this context
  104 | for(i=0; i<L2.Count; i++) L2[i]=L2[i]+1;
      |               ^~~~~
foo.cc:12:9: note: declared private here
   12 |     int Count;
      |         ^~~~~
foo.cc:104:15: note: field ‘int LinkList::Count’ can be accessed via ‘int LinkList::GetCount() const’
  104 | for(i=0; i<L2.Count; i++) L2[i]=L2[i]+1;
      |               ^~~~~
      |               GetCount()
foo.cc:106:15: error: ‘int LinkList::Count’ is private within this context
  106 | for(i=0; i<L1.Count; i++) L1Sum+=L1[i];
      |               ^~~~~
foo.cc:12:9: note: declared private here
   12 |     int Count;
      |         ^~~~~
foo.cc:106:15: note: field ‘int LinkList::Count’ can be accessed via ‘int LinkList::GetCount() const’
  106 | for(i=0; i<L1.Count; i++) L1Sum+=L1[i];
      |               ^~~~~
      |               GetCount()
foo.cc:108:15: error: ‘int LinkList::Count’ is private within this context
  108 | for(i=0; i<L2.Count; i++) L2Sum+=L2[i];
      |               ^~~~~
foo.cc:12:9: note: declared private here
   12 |     int Count;
      |         ^~~~~
foo.cc:108:15: note: field ‘int LinkList::Count’ can be accessed via ‘int LinkList::GetCount() const’
  108 | for(i=0; i<L2.Count; i++) L2Sum+=L2[i];
      |               ^~~~~
      |               GetCount()

信息

递交者
类型
自测
题目
P1027 OO7-2 把链表对象包装成数组
语言
C++
递交时间
2024-04-06 15:23:15
评测时间
2024-04-06 15:23:15
评测机
分数
0
总耗时
0ms
峰值内存
0 Bytes