iamthwee
Posting Expert
5,950 posts since Aug 2005
Reputation Points: 1,543
Solved Threads: 439
iamthwee
Posting Expert
5,950 posts since Aug 2005
Reputation Points: 1,543
Solved Threads: 439
My guess is that you are couting a variable that has yet to be initialised to some arbitary value.
At the beginning try doing:
timearray[0] = 0;
timearray[1] = 0;
answer = 0;
then do the rest... so get the user to do the cins
And maybe you're couting timearray[3] without actually assigning it to answer, i.e:
timearray[3] = answer;
iamthwee
Posting Expert
5,950 posts since Aug 2005
Reputation Points: 1,543
Solved Threads: 439
> would you be able to make me a basic program with an array that times
> 2 numbers from the array and shows it to the user
Why can't you create one, to explore the problem for yourself.
If you can get it to work, you might be able to figure out the answer to your bigger question.
If not, then at least you have something small to post here.
Salem
Posting Sage
11,531 posts since Dec 2005
Reputation Points: 5,862
Solved Threads: 953
My guess is that you are couting a variable that has yet to be initialised to some arbitary value.
Actually, you may be cout ing a variable that has an arbitrary value, and you should initialize it to aspecific value.
WaltP
Posting Sage w/ dash of thyme
10,505 posts since May 2006
Reputation Points: 3,348
Solved Threads: 944
Please post what you have tried.
iamthwee
Posting Expert
5,950 posts since Aug 2005
Reputation Points: 1,543
Solved Threads: 439
I think in this instance it would be wise to post all your code. I'm wondering how you've declared timeArray ?
Are they public or private declarations?And I think you're confusing the pointer notation. Anyway, post all your code, then we won't have to guess.
iamthwee
Posting Expert
5,950 posts since Aug 2005
Reputation Points: 1,543
Solved Threads: 439