you can implement the multiply and divide using addition and substraction which you had implemented like this:
code:
Code:
class longInteger {
public:
.........
longInteger operator+(const longInteger& oprand);
longInteger operator+(int opint);
longInteger operator-(longInteger& oprand);
longInteger operator*(longInteger& oprand);
longInteger operator/(longInteger& oprand);
........
private:
......
};
longInteger longInteger::operator*(longInteger& oprand) {
longInteger result(*this),i;
for(i=0;i<oprand;i=i+1)
result = result + *this
}
return result
}
longInteger longInteger::operator/(longInteger& oprand) {
longInteger result(0), val(*this);
while((val = (val - oprand)) >0) {
result = result +1;
}
return result
}
also you have to implement the operator>, constructor,copy constructor, operator=, ...
I just give you a algorithm, my code might not work cuz I haven't had it tested.
Hope it could help you!