Add two integers together 20 digits or less

My assignment is to have the user enter two numbers that have 20 digits or less and then output the sum. If the sum has more than 20 numbers have the message shown. It is required that I have at least a function to read and store a number into an array and another function to output the sum of numbers. I did the initial step of reversing the numbers so it can be read, but I'm totally stuck with the sum part, I have no idea how to make a sum out of what I got at the moment.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
#include <iostream>
#include <string>
 system("pause") or input loop */
using namespace std;

const int MAX = 20;
int readNum(int [], int[]);
int totalsum(int [], int[]);

int main(int argc, char** argv) {
	
	int num1[MAX] = {0};
	int num2[MAX] = {0};

	readNum(num1, num2);
	
	return 0;
}

int readNum(int Inpt1[], int Inpt2[])
{   
	string number1, number2;
	cout << "Enter a number: ";
	cin >> number1;
	if (number1.length() > MAX)
	{
			cout << "More than 20 digits, terminated. ";
		return -1;
	}
	int j = 0;
	for(int i = number1.length()-1; i >= 0; i--)
	{
		Inpt1[j]=static_cast <int>(number1.at(i) - '0');
		cout << Inpt1[j] << " ";
	}  
	cout << "\nEnter another number: ";
	cin >> number2;
		if (number2.length() > MAX)
	{
			cout << "More than 20 digits, terminated. ";
		return -1;
	}
	int l = 0;
	for(int k = number2.length()-1; k >= 0; k--)
	{
		Inpt2[l]=static_cast <int>(number2.at(k) - '0');
		cout << Inpt2[l] << " ";
	}
	
	

	return 1;
}

Can you show me an example for the input & output of the program you want?
Yeah sure thing!

Enter a number: 1234567
Enter another Number: 9876
Sum: 1244443

Enter a number: 123456789012345678901278
More than 20 digits, terminated.

*I don't need a while loop I just wanted to show you an extra example for if a user entered a number more than 20 digits.*
I found a video that explains this problem in C++:

https://www.youtube.com/watch?v=pP6GWIaiELM
Topic archived. No new replies allowed.