Dynamic array question

This is a discussion on Dynamic array question within the C++ Programming forums, part of the General Programming Boards category; How to write functions to add 2 big integers with dynamic arrays?
The 2 integers are input by users.
2 ...

Dynamic array question

How to write functions to add 2 big integers with dynamic arrays?
The 2 integers are input by users.
2 integer arrays store the input such that :
x[0]=number of digits
x[1]=1 st digit of the integer input (starting from the right)
x[2]=2 nd digit of the integer input
... & so on
eg.
input integer 1: 456
x[0]=3
x[1]=6
...

There is function to store the input:
void input(int*);
Another takes the 2 integer arrays as parameter to add the integers.
int *add(int *,int*);

How to divide the input integers into digits?
If I know how to write void input(int*), then I may know how to write int *add(int *,int*)
Anyone can help? Any similar example on the net that can inspire me?

I can see that you might store 5 in x[0] representing the length, but what would you store in x[1]?
Would it be '1', the first digit of input?
Would it be '9', the least significant value of the input?

> how to divide the input integer into digits
It's a lot easier if you read it as a string, expecially if you're considering very long input.

The rest is just modelling how you would add two numbers on paper
- start at the right, and add with carry your way to the left.

I can see that you might store 5 in x[0] representing the length, but what would you store in x[1]?
Would it be '1', the first digit of input?
Would it be '9', the least significant value of the input?

> how to divide the input integer into digits
It's a lot easier if you read it as a string, expecially if you're considering very long input.

The rest is just modelling how you would add two numbers on paper
- start at the right, and add with carry your way to the left.

Oops,I forgot to mention that, sorry.
It should be reverse so x[1] should be 9 according to your example.
If string can't be used, how to divide the integer into digits?
I asked this question as it is given that the function to store the input:
void input(int*);
takes an integer as parameter.