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)提供评测服务