记录详情

Compile Error

/in/foo.cc: In member function 'Vector3 Matrix3::operator*(const Vector3&) const':
/in/foo.cc:47:33: error: 'int Vector3::x' is private within this context
   47 |         int newX=v[0][0]*vector.x+v[0][1]*vector.y+v[0][2]*vector.z;
      |                                 ^
/in/foo.cc:6:9: note: declared private here
    6 |     int x,y,z;
      |         ^
/in/foo.cc:47:50: error: 'int Vector3::y' is private within this context
   47 |         int newX=v[0][0]*vector.x+v[0][1]*vector.y+v[0][2]*vector.z;
      |                                                  ^
/in/foo.cc:6:11: note: declared private here
    6 |     int x,y,z;
      |           ^
/in/foo.cc:47:67: error: 'int Vector3::z' is private within this context
   47 |         int newX=v[0][0]*vector.x+v[0][1]*vector.y+v[0][2]*vector.z;
      |                                                                   ^
/in/foo.cc:6:13: note: declared private here
    6 |     int x,y,z;
      |             ^
/in/foo.cc:48:33: error: 'int Vector3::x' is private within this context
   48 |         int newY=v[1][0]*vector.x+v[1][1]*vector.y+v[1][2]*vector.z;
      |                                 ^
/in/foo.cc:6:9: note: declared private here
    6 |     int x,y,z;
      |         ^
/in/foo.cc:48:50: error: 'int Vector3::y' is private within this context
   48 |         int newY=v[1][0]*vector.x+v[1][1]*vector.y+v[1][2]*vector.z;
      |                                                  ^
/in/foo.cc:6:11: note: declared private here
    6 |     int x,y,z;
      |           ^
/in/foo.cc:48:67: error: 'int Vector3::z' is private within this context
   48 |         int newY=v[1][0]*vector.x+v[1][1]*vector.y+v[1][2]*vector.z;
      |                                                                   ^
/in/foo.cc:6:13: note: declared private here
    6 |     int x,y,z;
      |             ^
/in/foo.cc:49:33: error: 'int Vector3::x' is private within this context
   49 |         int newZ=v[2][0]*vector.x+v[2][1]*vector.y+v[2][2]*vector.z;
      |                                 ^
/in/foo.cc:6:9: note: declared private here
    6 |     int x,y,z;
      |         ^
/in/foo.cc:49:50: error: 'int Vector3::y' is private within this context
   49 |         int newZ=v[2][0]*vector.x+v[2][1]*vector.y+v[2][2]*vector.z;
      |                                                  ^
/in/foo.cc:6:11: note: declared private here
    6 |     int x,y,z;
      |           ^
/in/foo.cc:49:67: error: 'int Vector3::z' is private within this context
   49 |         int newZ=v[2][0]*vector.x+v[2][1]*vector.y+v[2][2]*vector.z;
      |                                                                   ^
/in/foo.cc:6:13: note: declared private here
    6 |     int x,y,z;
      |             ^
/in/foo.cc: In member function 'Vector3 Vector3::operator*(const Matrix3&) const':
/in/foo.cc:73:23: error: 'int Matrix3::v [3][3]' is private within this context
   73 |     int newX=x*matrix.v[0][0]+y*matrix.v[0][1]+z*matrix.v[0][2];
      |                       ^
/in/foo.cc:26:9: note: declared private here
   26 |     int v[3][3];
      |         ^
/in/foo.cc:73:40: error: 'int Matrix3::v [3][3]' is private within this context
   73 |     int newX=x*matrix.v[0][0]+y*matrix.v[0][1]+z*matrix.v[0][2];
      |                                        ^
/in/foo.cc:26:9: note: declared private here
   26 |     int v[3][3];
      |         ^
/in/foo.cc:73:57: error: 'int Matrix3::v [3][3]' is private within this context
   73 |     int newX=x*matrix.v[0][0]+y*matrix.v[0][1]+z*matrix.v[0][2];
      |                                                         ^
/in/foo.cc:26:9: note: declared private here
   26 |     int v[3][3];
      |         ^
/in/foo.cc:74:23: error: 'int Matrix3::v [3][3]' is private within this context
   74 |     int newY=x*matrix.v[1][0]+y*matrix.v[1][1]+z*matrix.v[1][2];
      |                       ^
/in/foo.cc:26:9: note: declared private here
   26 |     int v[3][3];
      |         ^
/in/foo.cc:74:40: error: 'int Matrix3::v [3][3]' is private within this context
   74 |     int newY=x*matrix.v[1][0]+y*matrix.v[1][1]+z*matrix.v[1][2];
      |                                        ^
/in/foo.cc:26:9: note: declared private here
   26 |     int v[3][3];
      |         ^
/in/foo.cc:74:57: error: 'int Matrix3::v [3][3]' is private within this context
   74 |     int newY=x*matrix.v[1][0]+y*matrix.v[1][1]+z*matrix.v[1][2];
      |                                                         ^
/in/foo.cc:26:9: note: declared private here
   26 |     int v[3][3];
      |         ^
/in/foo.cc:75:23: error: 'int Matrix3::v [3][3]' is private within this context
   75 |     int newZ=x*matrix.v[2][0]+y*matrix.v[2][1]+z*matrix.v[2][2];
      |                       ^
/in/foo.cc:26:9: note: declared private here
   26 |     int v[3][3];
      |         ^
/in/foo.cc:75:40: error: 'int Matrix3::v [3][3]' is private within this context
   75 |     int newZ=x*matrix.v[2][0]+y*matrix.v[2][1]+z*matrix.v[2][2];
      |                                        ^
/in/foo.cc:26:9: note: declared private here
   26 |     int v[3][3];
      |         ^
/in/foo.cc:75:57: error: 'int Matrix3::v [3][3]' is private within this context
   75 |     int newZ=x*matrix.v[2][0]+y*matrix.v[2][1]+z*matrix.v[2][2];
      |                                                         ^
/in/foo.cc:26:9: note: declared private here
   26 |     int v[3][3];
      |         ^

信息

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