Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- class Complex
- {
- int a, b;
- public:
- Complex() { b = 2; }
- Complex(int a, int b)
- {
- this->a = a;
- this->b = b;
- }
- int egal(Complex c2);
- };
- int Complex::egal(Complex c2)
- {
- this->a = a;
- this->b = b;
- if (a == b)
- return 1;
- else
- return 0;
- }
- int main()
- {
- Complex c1(2, 2);
- Complex c3;
- cout<<c1.egal(c1);
- system("pause");
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement