Since I learned arrays a couple of days ago I got really annoyed when this program didn't worked, could anyone give me a hint?
What happened is, instead of outputtingCode:#include <iostream.h> #include <cstdio> //required to pause using namespace std; //required to pause int main() { int array[4] = { 10, 20, 30, 40 }; cout<<array[1]<<endl; cout<<array[2]<<endl; cout<<array[3]<<endl; cout<<array[4]<<endl; getchar(); //pause getchar(); //pause return 0; }
it outputtedCode:10 20 30 40
Code:20 30 40 4370432