Elements of 2 Arrays will sum and be added to a 3rd one

Hello guys, I am very new at the C++ programming world, but I have been reading books, viewing youtube videos, and such.
I am to create 2 arrays, give out their elements; then sum them up and display them in a third array.
I understand the code is bad, it does work but it only sums the first value of each "array" so their not really arrays. This is what I've gotten so far:

#include <iostream>
#include <stdlib.h>

using namespace std;

int main (){

int Num1[0]; //arreglo numero 1
int Num2[0]; //arreglo numero 2
int suma[0]; //Arreglo de Suma


cout << " Escriba un numero para el arreglo 1: ";
cin >> Num1[0]; //arreglo numero 1


cout << " Escriba un numero para el arreglo 2: ";
cin >> Num2[0]; //arreglo numero 2

suma[0] = Num1[0]+Num2[0]; //operacion de suma de los 2 arreglos

cout << " La suma de los dos arreglos dados es: " << suma[0] << endl;
//Resultado de la suma de los dos arreglos


I will accept any critics and recommendations to make sure I comprehend this better.

Thanks.
To declare an array of single element (is that an oxymoron?):
int array1[1];

then use the statement:
cin >> array1[0]

to make use of the array...

so to use your code correctly add this line:
int Num1[1], Num2[1], suma[1];

and read this: http://www.cplusplus.com/doc/tutorial/arrays/
Topic archived. No new replies allowed.