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?



LinkBack URL
About LinkBacks


