The program consists in storing elements in an array and then displaying them in screen. The function of storing the array works but then when calling the array in the other function shows on the screen negative and very long numbers.
I guess the error is in:
tArrayNumber to
const tArrayNumber a
#include<iostream>
using namespace std;
const int MAX=3;
typedef int tArrayNumero[MAX];
void valoresArray();
void mostrarArray(const tArrayNumero a);
int main()
{
tArrayNumero a;
valoresArray();
mostrarArray(a);
return 0;
}
void valoresArray()
{
tArrayNumero a;
cout << "Introduzca los valores del array";
for(int i=0; i<MAX; i++)
{
cin >> a[i];
}
}
void mostrarArray(const tArrayNumero a)
{
for(int i=0; i<MAX; i++)
{
cout << a[i];
}
}