Compile Error
/in/foo.cc: In function 'std::ostream& operator<<(std::ostream&, const Complex&)': /in/foo.cc:17:26: error: assignment of member 'Complex::imag' in read-only object 17 | if(c.imag=0){ | ~~~~~~^~ /in/foo.cc: In function 'int main()': /in/foo.cc:25:45: error: a function-definition is not allowed here before '{' token 25 | void bubbleSort(Complex arr[],int n){ | ^ /in/foo.cc:44:5: error: 'bubbleSort' was not declared in this scope 44 | bubbleSort(arr,3); | ^~~~~~~~~~
信息
- 递交者
- 类型
- 自测
- 题目
- P1012 OO2-2 复数类的比较运算符重载
- 语言
- C++
- 递交时间
- 2025-03-22 19:03:00
- 评测时间
- 2025-03-22 19:03:00
- 评测机
- 分数
- 0
- 总耗时
- 0ms
- 峰值内存
- 0 Bytes