Hello.
I've decided to teach myself C++. So for the past week or so I've been reading the tutorials on this site, doing the examples etc. I finished the tutorials and decided to try the challenges. And I got stuck on the first!!!
After trying unsuccessfully to get my program to work, I looked at Cprogramming.com's solution, compiled it, ran it, and even the solution doesn't work!
When running it fills in the element of the array (I presume) but it does not list them(I take list to mean print) and instead just exits.
So, is my compiler broken? Or is there some incredibly noobish mistake that i can't see(most likely)
Below is the solution, as posted by Cprogramming.com:
When completed, the following program should first fill in (by asking the user for
input) and then list all the elements in an array:
Hope I've clarified enoughCode:#include <iostream> using namespace std; int main() { int array[8]; for(int x=0; x<8; x++) cin>> array[x]; for(int x=0; x<8; x++) cout<< array[x]; return 0; }