I wrote a code to print the components of an array in reverse order. However, it only returns 5 or 6 numbers (at most), even though I have put more numbers in it.
#include <iostream>
using namespace std;
int main()
{
int i;
int vet[i];
cin >> i; /*Tamanho do array*/
for(int t = 0; t<i; t++) /*Adiciona coisas no array*/
{
cin >> vet[t];
}
for(int f = i-1; f>=0; f--) /*Imprime o que tem dentro do array em ordem inversa*/
{
cout << vet[f] << " ";
}
}
Is anything missing?