记录详情

Compile Error

foo.cc:20:20: error: 'Matirx3' has not been declared
   20 |  Vector3 operator*(Matirx3& m) {
      |                    ^~~~~~~
foo.cc: In member function 'Vector3 Vector3::operator*(int&)':
foo.cc:23:17: error: request for member 'v' in 'm', which is of non-class type 'int'
   23 |    v.x += x * m.v[i][0];
      |                 ^
foo.cc:24:17: error: request for member 'v' in 'm', which is of non-class type 'int'
   24 |    v.y += y * m.v[i][1];
      |                 ^
foo.cc:25:17: error: request for member 'v' in 'm', which is of non-class type 'int'
   25 |    v.z += z * m.v[i][2];
      |                 ^
foo.cc: In function 'int main()':
foo.cc:85:18: error: no match for 'operator*' (operand types are 'Vector3' and 'Matirx3')
   85 |  Vector3 v2 = vv * mm;
      |               ~~ ^ ~~
      |               |    |
      |               |    Matirx3
      |               Vector3
foo.cc:13:10: note: candidate: 'Vector3 Vector3::operator*(Vector3&)'
   13 |  Vector3 operator*(Vector3& vec) {
      |          ^~~~~~~~
foo.cc:13:29: note:   no known conversion for argument 1 from 'Matirx3' to 'Vector3&'
   13 |  Vector3 operator*(Vector3& vec) {
      |                    ~~~~~~~~~^~~
foo.cc:20:10: note: candidate: 'Vector3 Vector3::operator*(int&)'
   20 |  Vector3 operator*(Matirx3& m) {
      |          ^~~~~~~~
foo.cc:20:29: note:   no known conversion for argument 1 from 'Matirx3' to 'int&'
   20 |  Vector3 operator*(Matirx3& m) {
      |                    ~~~~~~~~~^
[Hydro](https://hydro.ac)提供评测服务

信息

递交者
类型
自测
题目
P1020 OO4-4 矩阵类与向量类的算术运算符重载
语言
C++
递交时间
2022-05-14 19:57:08
评测时间
2022-05-14 19:57:08
评测机
分数
0
总耗时
0ms
峰值内存
0 Bytes