I have a problem that about operator<< in LargeInt. When I Run this program. operator always print 1 end of any number. for example, I input 12. it will output 121. i checked all of other function.they are working well.
only operator << How can i fix this problem
Here is my code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
template<class x>
x DoublyLink<x>::printInfo(DoublyLink<x>& other)
{
bool result=true;
if (other.isEmpty())
{
result = false;
cout << "The list is empty";
}
elseif(result)
{
node<x> *p;
for (p = other.last;p != other.first->prev;p = p->prev)
cout<<p->info;
}
return result;
}