bool operator==(const complex<X>& kqrZ1, const complex<X>& kqrZ2);
#include <complex>
bool operator==(const complex<X>& kqrZ, const X& kxrX); bool operator==(const X& kxrX, const complex<X>& kqrZ);
#include <complex>
#include <iostream>
int main()
{
using namespace std;
// Create two complex numbers and compare them
complex<double> qZ1(2.0, 4.0);
complex<double> qZ2(1.0, 1.0);
cout << qZ1 << (qZ1 == qZ1 ? " is" : " is not") << " equal to " << qZ1 << endl;
cout << qZ1 << (qZ1 == qZ2 ? " is" : " is not") << " equal to " << qZ2 << endl;
cout << qZ2 << (qZ2 == qZ2 ? " is" : " is not") << " equal to " << qZ2 << endl;
// Keep the window open
cin.get();
return 0;
}
© 20072025 XoaX.net LLC. All rights reserved.