placing an unknown int size into a dyanmic array

How do I take an integer of unknown size and store each integer (0-9) in a dynamic array. I know how to take a sing int (0-9) and turn it into a char, but if I have the integer 123, I need to store 1 in slot 0, 2 in slot 1, and 3 in slot 3 of the array/ I cannot use strings, only C++ type.
oversize the array. (how big could be your number)
the assignment states: there should never be more than 5 unused array slots left in the array at the end of any public operation. not to mention the number could be in the billions or trillions. So oversizeing is not an option
closed account (D80DSL3A)
1
2
#include <cmath>
int Ndigits = 1 + (int)log10( (double)Number );
It sounds like you are being asked to write your own version of the std::vector class?
Topic archived. No new replies allowed.