记录详情

Compile Error

foo.cc: In member function 'Vector3& Vector3::operator=(const Vector3&)':
foo.cc:71:2: warning: no return statement in function returning non-void [-Wreturn-type]
   70 |   z = a.z;
  +++ |+  return *this;
   71 |  }
      |  ^
foo.cc: At global scope:
foo.cc:82:14: error: 'n' has not been declared
   82 |  void Output(n)
      |              ^
foo.cc:87:12: error: ISO C++ forbids declaration of 'Sort' with no type [-fpermissive]
   87 |  Sort(int n)
      |            ^
foo.cc:80:10: error: flexible array member 'Vector3Array::a' in an otherwise empty 'class Vector3Array'
   80 |  Vector3 a[];
      |          ^
foo.cc: In member function 'void Vector3Array::Output(int)':
foo.cc:84:17: error: 'n' was not declared in this scope
   84 |   for(int i=0;i<n;i++)
      |                 ^
foo.cc: In member function 'int Vector3Array::Sort(int)':
foo.cc:98:2: warning: no return statement in function returning non-void [-Wreturn-type]
   98 |  }
      |  ^
foo.cc: In function 'int main()':
foo.cc:105:18: error: no matching function for call to 'Vector3Array::Vector3Array(int&)'
  105 |  Vector3Array A(n);
      |                  ^
foo.cc:78:7: note: candidate: 'Vector3Array::Vector3Array()'
   78 | class Vector3Array
      |       ^~~~~~~~~~~~
foo.cc:78:7: note:   candidate expects 0 arguments, 1 provided
foo.cc:78:7: note: candidate: 'Vector3Array::Vector3Array(const Vector3Array&)'
foo.cc:78:7: note:   no known conversion for argument 1 from 'int' to 'const Vector3Array&'
foo.cc:78:7: note: candidate: 'Vector3Array::Vector3Array(Vector3Array&&)'
foo.cc:78:7: note:   no known conversion for argument 1 from 'int' to 'Vector3Array&&'
[Hydro](https://hydro.ac)提供评测服务

信息

递交者
类型
自测
题目
P1018 OO4-2 向量的比较、赋值及向量集合类的排序
语言
C++
递交时间
2022-04-30 14:24:32
评测时间
2022-04-30 14:24:32
评测机
分数
0
总耗时
0ms
峰值内存
0 Bytes