Created
February 22, 2012 07:11
-
-
Save draggor/1882963 to your computer and use it in GitHub Desktop.
tester
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
#include "Number.h" | |
using namespace std; | |
int main() | |
{ | |
Number n(10); | |
cout << "n.toString() 10=" << n.toString() << endl; | |
cout << endl; | |
cout << "n++ before 10=" << n++ << ", n++ after 11=" << n << endl; | |
cout << "++n before 12=" << ++n << ", ++n after 12=" << n << endl; | |
cout << "n-- before 12=" << n-- << ", n-- after 11=" << n << endl; | |
cout << "--n before 10=" << --n << ", --n after 10=" << n << endl; | |
cout << endl; | |
Number a(5); | |
Number b(8); | |
cout << "a + b = 13 = " << a + b << endl; | |
cout << "a - b = -3 = " << a - b << endl; | |
cout << "a * b = 40 = " << a * b << endl; | |
cout << "-a = -5 = " << -a << endl; | |
cout << "a < b = 1 = " << (a < b) << endl; | |
cout << "a > b = 0 = " << (a > b) << endl; | |
cout << "a == b = 0 = " << (a == b) << endl; | |
cout << "a == a = 1 = " << (a == a) << endl; | |
cout << endl; | |
cout << "a = b = 8 = " << (a = b) << endl; | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment