Hi, I'm sorta new to c++ I've tried messing around with java but I like c++ better for it's speed. I think the reason why I'm still a newbie at this is because I can't grasp the scientific concept of the syntax. But enough small talk......
I can't seem to find how to fix this program????
(I've googled and searched for hours on this subject)
I'm trying to query 10 numbers then output all the numbers back. It works but not like a query.
I just don't understand what I'm doing wrong I'm sure I'll kick myself once I get it sorted out.
here's my code:
#include <iostream>
#include <cstdlib>
using namespace std;
int main()
{
int i, numEntered;
int number[10];
for (i = 0; i <= 9; i++)
{
//--Here's where I think the problem is
cout<<"Number: ";
cin>>numEntered; //Ask for a number
numEntered = number[i];
}
cout<<"Numbers entered: "<< numEntered<<endl; //output 10 inputed numbers
system("pause"); //Pause the screen so one can see the result
return 0;
}
It gives me some weird output like a string of numbers like... 1988145407.
I'd really like to know the reason for the bug.
Thanks in advance.....