记录详情

Compile Error

/in/foo.cc:10:25: error: 'Matrix' does not name a type
  Vector operator*(const Matrix&m2);
                         ^~~~~~
/in/foo.cc:91:8: error: prototype for 'Vector Vector::operator*(const Matrix&)' does not match any in class 'Vector'
 Vector Vector::operator*(const Matrix&m2)
        ^~~~~~
/in/foo.cc:28:9: error: candidates are: Vector Vector::operator*(const Vector&)
  Vector operator*(const Vector&v2)
         ^~~~~~~~
/in/foo.cc:10:9: error:                 Vector Vector::operator*(const int&)
  Vector operator*(const Matrix&m2);
         ^~~~~~~~
/in/foo.cc: In function 'int main()':
/in/foo.cc:110:9: error: no match for 'operator*' (operand types are 'Vector' and 'Matrix')
  v2 = v * m;
       ~~^~~
/in/foo.cc:10:9: note: candidate: Vector Vector::operator*(const int&)
  Vector operator*(const Matrix&m2);
         ^~~~~~~~
/in/foo.cc:10:9: note:   no known conversion for argument 1 from 'Matrix' to 'const int&'
/in/foo.cc:28:9: note: candidate: Vector Vector::operator*(const Vector&)
  Vector operator*(const Vector&v2)
         ^~~~~~~~
/in/foo.cc:28:9: note:   no known conversion for argument 1 from 'Matrix' to 'const Vector&'

信息

递交者
类型
递交
题目
P1020 OO4-4 矩阵类与向量类的算术运算符重载
语言
C++
递交时间
2019-06-17 17:09:48
评测时间
2019-06-17 17:09:48
评测机
分数
0
总耗时
0ms
峰值内存
0 Bytes