Here is my task: Write a program that inputs two positive integers of, at most, 20 digits and outputs the sum of the numbers. If the sum of the numbers has more than 20 digits, output the sum with an appropriate message. Your program must, at least, contain a function to read and store a number into an array and another function to output the sum of the numbers. (Hint: Read numbers as strings and store the digits of the number in the reverse order.) 

Ive pretty much gotten things fixed, its just that my output is printing each index's sum rather than a whole number with multiple digits. Also, I tried to add code to deter the user from typing over 20 characters but I get an error regarding the string variable not being able to used in this statement: if (user\_str1>20)

```
    int read_strings(int arr1[], int arr2[])
{
    string user_str1;
    string user_str2;

    cout << "enter a positive integer of, at most, 20 digits " << endl;
    cin >> user_str1;

    for (int ind2 = user_str1.length() - 1; ind2 >= 0; ind2--)
    {
        arr1[ind2] = static_cast<int>(user_str1[ind2]) - static_cast<int>    ('0');
    }

    cout << "now enter a second number with the same conditions as the first      " << endl;
    cin >> user_str2;

    for (int d = user_str2.length() - 1; d >= 0; d--)
    {
        arr2[d] = static_cast<int>(user_str2[d]) - static_cast<int>('0');
    }
    return user_str1.length();
}
void print_sum(int arr1[], int arr2[], int size)
{
    string user_str1;
    string user_str2;

    int sum_arr[20];

    int carry = 0;
    for (int e = 0; e < size; e++)
    {
        if (arr1[e] + arr2[e] + carry > 9)
        {
            sum_arr[e] = arr1[e] + arr2[e] + carry;
            sum_arr[e] = sum_arr[e] % 10;
            carry = 1;
        }
        else
        {
            sum_arr[e] = arr1[e] + arr2[e] + carry;
            carry = 0;
        }
        cout << "the sum of the two arrays is: " << sum_arr[e];
        cout << endl;
    }

}
int main(){

    int arr1[20];
    int arr2[20];
    int size = read_strings(arr1, arr2);
    print_sum(arr1, arr2, size);
    return 0;

}

```