1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29
|
#include "hugeInteger.h"
#include <iostream>
#include <string>
#include <sstream>
#include <cstdlib>
#include <iomanip>
using namespace std;
int main()
{
int aop1[5] = {3,7,1,3,7};
int aop2[5] = {1,5,9,3,4};
hugeInteger sum; // makes an object using the default contructor
// from .h file, which will eventually hold the
// objects op1, and op2
hugeInteger op1(aop1, 5) , op2(aop2, 5); // two objects using copy contruct
op1.print();
cout << endl;
op2.print();
cout << endl;
//sum = op1.add(op2); // will add objects op1, op2 together
sum = op1 + op2; // after overloading operator +, sum contains
// op1,op2
sum.print();
cout << endl;
}
|