diff --git a/tut31.cpp b/tut31.cpp index bc521c6..f40b771 100644 --- a/tut31.cpp +++ b/tut31.cpp @@ -8,29 +8,30 @@ class Complex int a, b; public: - Complex(){ + Complex(); + Complex(int x, int y); + Complex(int x); + void printNumber(); +}; + Complex::Complex() + { a = 0; b =0; - } - - Complex(int x, int y) - { + } +Complex::Complex(int x, int y) +{ a = x; b = y; - } - - Complex(int x){ +} +Complex::Complex(int x) +{ a = x; b = 0; - } - - - - void printNumber() - { +} +void Complex::printNumber() +{ cout << "Your number is " << a << " + " << b << "i" << endl; - } -}; +} int main() { Complex c1(4, 6);