记录详情

Compile Error

/in/foo.cc: In member function 'bool Complex::operator==(Complex)':
/in/foo.cc:42:29: error: 'pow' was not declared in this scope
   if (sqrt(pow(this->real, 2) + pow(this->imaginary, 2)) == sqrt(pow(objRight.real, 2) + pow(objRight.imaginary, 2)))
                             ^
/in/foo.cc:42:56: error: 'sqrt' was not declared in this scope
   if (sqrt(pow(this->real, 2) + pow(this->imaginary, 2)) == sqrt(pow(objRight.real, 2) + pow(objRight.imaginary, 2)))
                                                        ^
/in/foo.cc: In member function 'bool Complex::operator>(Complex)':
/in/foo.cc:49:29: error: 'pow' was not declared in this scope
   if (sqrt(pow(this->real, 2) + pow(this->imaginary, 2)) > sqrt(pow(objRight.real, 2) + pow(objRight.imaginary, 2)))
                             ^
/in/foo.cc:49:56: error: 'sqrt' was not declared in this scope
   if (sqrt(pow(this->real, 2) + pow(this->imaginary, 2)) > sqrt(pow(objRight.real, 2) + pow(objRight.imaginary, 2)))
                                                        ^
/in/foo.cc: In member function 'bool Complex::operator>=(Complex)':
/in/foo.cc:56:29: error: 'pow' was not declared in this scope
   if (sqrt(pow(this->real, 2) + pow(this->imaginary, 2)) >= sqrt(pow(objRight.real, 2) + pow(objRight.imaginary, 2)))
                             ^
/in/foo.cc:56:56: error: 'sqrt' was not declared in this scope
   if (sqrt(pow(this->real, 2) + pow(this->imaginary, 2)) >= sqrt(pow(objRight.real, 2) + pow(objRight.imaginary, 2)))
                                                        ^
/in/foo.cc: In member function 'bool Complex::operator<(Complex)':
/in/foo.cc:63:29: error: 'pow' was not declared in this scope
   if (sqrt(pow(this->real, 2) + pow(this->imaginary, 2)) < sqrt(pow(objRight.real, 2) + pow(objRight.imaginary, 2)))
                             ^
/in/foo.cc:63:56: error: 'sqrt' was not declared in this scope
   if (sqrt(pow(this->real, 2) + pow(this->imaginary, 2)) < sqrt(pow(objRight.real, 2) + pow(objRight.imaginary, 2)))
                                                        ^
/in/foo.cc: In member function 'bool Complex::operator<=(Complex)':
/in/foo.cc:70:29: error: 'pow' was not declared in this scope
   if (sqrt(pow(this->real, 2) + pow(this->imaginary, 2)) <= sqrt(pow(objRight.real, 2) + pow(objRight.imaginary, 2)))
                             ^
/in/foo.cc:70:56: error: 'sqrt' was not declared in this scope
   if (sqrt(pow(this->real, 2) + pow(this->imaginary, 2)) <= sqrt(pow(objRight.real, 2) + pow(objRight.imaginary, 2)))
                                                        ^
/in/foo.cc: In static member function 'static void Complex::Sort(std::vector<Complex>*)':
/in/foo.cc:80:16: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
   for (i = 0; i<ptr_vtInstance->size(); i++)
               ~^~~~~~~~~~~~~~~~~~~~~~~
/in/foo.cc:87:19: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
     for (j = 0; j < ptr_vtComplex->size(); j++)
                 ~~^~~~~~~~~~~~~~~~~~~~~~~
/in/foo.cc:96:11: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
     if (j == ptr_vtComplex->size())
         ~~^~~~~~~~~~~~~~~~~~~~~~~~
/in/foo.cc:101:16: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
   for (i = 0; i<ptr_vtComplex->size(); i++)
               ~^~~~~~~~~~~~~~~~~~~~~~
/in/foo.cc: In static member function 'static void Complex::VectorDisplay(std::vector<Complex>*)':
/in/foo.cc:116:17: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
   for (i = 0; i < ptr_vtInstance->size(); i++)
               ~~^~~~~~~~~~~~~~~~~~~~~~~~
/in/foo.cc: In member function 'bool Complex::operator<=(Complex)':
/in/foo.cc:74:2: warning: control reaches end of non-void function [-Wreturn-type]
  }
  ^

信息

递交者
类型
递交
题目
P1012 OO2-2 复数类的比较运算符重载
语言
C++
递交时间
2023-10-03 03:46:27
评测时间
2023-10-03 03:46:27
评测机
分数
0
总耗时
0ms
峰值内存
0 Bytes