记录详情

Runtime Error

foo.cc: In member function ‘complex& complex::operator+(complex&)’:
foo.cc:32:24: warning: reference to local variable ‘h’ returned [-Wreturn-local-addr]
   32 |                 return h;
      |                        ^
foo.cc:31:25: note: declared here
   31 |                 complex h(x1, x2);
      |                         ^
foo.cc: In member function ‘complex& complex::operator*(complex&)’:
foo.cc:39:24: warning: reference to local variable ‘h’ returned [-Wreturn-local-addr]
   39 |                 return h;
      |                        ^
foo.cc:38:25: note: declared here
   38 |                 complex h(x1, x2);
      |                         ^
# 状态 耗时 内存占用
#1 Runtime Error Segmentation fault 2ms 324.0 KiB

信息

递交者
类型
自测
题目
P1011 OO2-1 复数类的算术、赋值运算符的重载
语言
C++
递交时间
2024-04-05 22:58:46
评测时间
2024-04-05 22:58:46
评测机
分数
0
总耗时
2ms
峰值内存
324.0 KiB