How do I add numbers of an array to another array?

  add, arrays, c++, c++17

I want to add the numbers of the array {1, 2, 3} to the array {7, 4, 6} so I can get an array {8, 6, 9} like this:

int main(){
    int arr[] = {1, 2, 3};
    int arr2[] = {7, 4, 6};
    arr += arr2; // invalid operands of types ‘int [3]’ and ‘int*’ to binary ‘operator+’
}

Source: Windows Questions C++

LEAVE A COMMENT