记录详情

Compile Error

/in/foo.cc:65:41: error: non-member function 'Vector3 operator*(const Matrix3&)' cannot have cv-qualifier
   65 | Vector3 operator*(const Matrix3& matrix)const{
      |                                         ^~~~~
/in/foo.cc: In function 'Vector3 operator*(const Matrix3&)':
/in/foo.cc:66:14: error: 'x' was not declared in this scope
   66 |     int newX=x*matrix.v[0][0]+y*matrix.v[0][1]+z*matrix.v[0][2];
      |              ^
/in/foo.cc:66:23: error: 'int Matrix3::v [3][3]' is private within this context
   66 |     int newX=x*matrix.v[0][0]+y*matrix.v[0][1]+z*matrix.v[0][2];
      |                       ^
/in/foo.cc:24:9: note: declared private here
   24 |     int v[3][3];
      |         ^
/in/foo.cc:66:31: error: 'y' was not declared in this scope
   66 |     int newX=x*matrix.v[0][0]+y*matrix.v[0][1]+z*matrix.v[0][2];
      |                               ^
/in/foo.cc:66:40: error: 'int Matrix3::v [3][3]' is private within this context
   66 |     int newX=x*matrix.v[0][0]+y*matrix.v[0][1]+z*matrix.v[0][2];
      |                                        ^
/in/foo.cc:24:9: note: declared private here
   24 |     int v[3][3];
      |         ^
/in/foo.cc:66:48: error: 'z' was not declared in this scope
   66 |     int newX=x*matrix.v[0][0]+y*matrix.v[0][1]+z*matrix.v[0][2];
      |                                                ^
/in/foo.cc:66:57: error: 'int Matrix3::v [3][3]' is private within this context
   66 |     int newX=x*matrix.v[0][0]+y*matrix.v[0][1]+z*matrix.v[0][2];
      |                                                         ^
/in/foo.cc:24:9: note: declared private here
   24 |     int v[3][3];
      |         ^
/in/foo.cc:67:23: error: 'int Matrix3::v [3][3]' is private within this context
   67 |     int newY=x*matrix.v[1][0]+y*matrix.v[1][1]+z*matrix.v[1][2];
      |                       ^
/in/foo.cc:24:9: note: declared private here
   24 |     int v[3][3];
      |         ^
/in/foo.cc:67:40: error: 'int Matrix3::v [3][3]' is private within this context
   67 |     int newY=x*matrix.v[1][0]+y*matrix.v[1][1]+z*matrix.v[1][2];
      |                                        ^
/in/foo.cc:24:9: note: declared private here
   24 |     int v[3][3];
      |         ^
/in/foo.cc:67:57: error: 'int Matrix3::v [3][3]' is private within this context
   67 |     int newY=x*matrix.v[1][0]+y*matrix.v[1][1]+z*matrix.v[1][2];
      |                                                         ^
/in/foo.cc:24:9: note: declared private here
   24 |     int v[3][3];
      |         ^
/in/foo.cc:68:23: error: 'int Matrix3::v [3][3]' is private within this context
   68 |     int newZ=x*matrix.v[2][0]+y*matrix.v[2][1]+z*matrix.v[2][2];
      |                       ^
/in/foo.cc:24:9: note: declared private here
   24 |     int v[3][3];
      |         ^
/in/foo.cc:68:40: error: 'int Matrix3::v [3][3]' is private within this context
   68 |     int newZ=x*matrix.v[2][0]+y*matrix.v[2][1]+z*matrix.v[2][2];
      |                                        ^
/in/foo.cc:24:9: note: declared private here
   24 |     int v[3][3];
      |         ^
/in/foo.cc:68:57: error: 'int Matrix3::v [3][3]' is private within this context
   68 |     int newZ=x*matrix.v[2][0]+y*matrix.v[2][1]+z*matrix.v[2][2];
      |                                                         ^
/in/foo.cc:24:9: note: declared private here
   24 |     int v[3][3];
      |         ^

信息

递交者
类型
自测
题目
P1020 OO4-4 矩阵类与向量类的算术运算符重载
语言
C++
递交时间
2025-03-29 20:53:23
评测时间
2025-03-29 20:53:23
评测机
分数
0
总耗时
0ms
峰值内存
0 Bytes