Skip to content

Instantly share code, notes, and snippets.

@draggor
Created February 22, 2012 07:11
Show Gist options
  • Save draggor/1882963 to your computer and use it in GitHub Desktop.
Save draggor/1882963 to your computer and use it in GitHub Desktop.
tester
#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