I'm writing a BigInt class (now with a vector containing the digits, instead of a string), and my program crashes when I try to use the overloaded output operator. First it outputs alot of garbage numbers, and then the program crashes. Can anyone help me with this?
Since you are converting the integer to a string, you end up putting each of the characters of the string into the vector of ints. This is legal, but the values in the vector will be the ASCII values associated with the characters representing the digits. When you print them out, you will get what appears to be garbage.