记录详情

Compile Error

/in/foo.cc: In member function 'BigInt& BigInt::operator*(BigInt&)':
/in/foo.cc:71:31: error: invalid initialization of non-const reference of type 'BigInt&' from an rvalue of type 'BigInt'
    res = *this * obj.value[i] << i;
          ~~~~~~~~~~~~~~~~~~~~~^~~~
/in/foo.cc:45:7: note:   initializing argument 1 of 'bool BigInt::operator=(BigInt&)'
  bool operator=(BigInt &bi)
       ^~~~~~~~
/in/foo.cc:72:14: error: invalid initialization of non-const reference of type 'BigInt&' from an rvalue of type 'BigInt'
    sum = sum + res;
          ~~~~^~~~~
/in/foo.cc:45:7: note:   initializing argument 1 of 'bool BigInt::operator=(BigInt&)'
  bool operator=(BigInt &bi)
       ^~~~~~~~
/in/foo.cc:67:18: warning: reference to local variable 'sum' returned [-Wreturn-local-addr]
   BigInt res(0), sum(0);
                  ^~~

信息

递交者
类型
自测
题目
P1023 OO6-1 高精度整数类的乘法运算
语言
C++
递交时间
2024-05-02 03:03:33
评测时间
2024-05-02 03:03:33
评测机
分数
0
总耗时
0ms
峰值内存
0 Bytes