So here I have two classes, on Safearray and one bigint calculator( the SafeArray is imperfect but it serves its purpose) what I really need help with is my multiply algorithm, when I compile nothing happens, I think the algorithm is mostly right(if not please help me fix it) but mostly I think the problem is returning and printing the final answer. Any help would be appreciated, Thanks.
void multiply(const bigint &A)
{
bigint temp1; // bigint with value 0
int carry = 0;
int shift = 0;
bigint temp2;
for(int j = size-1; j >= 0; j--) //no member size in bigint
{
for(int i=size-1; i>=0; i--)
{
// bigint with value 0 and size: size + A.size
int result = (arr->get(i)*A.arr->get(j)+carry);
if(size - shift - (i - size-1) >= 0)
temp2.arr->set(size - shift - (i - size-1), result%10);
else
break;
carry=result/10;
}
shift++;
temp1.add_pos(temp2);
}
this->assign(temp1);
}