Search:

Type: Posts; User: Cornix

Search: Search took 0.11 seconds.

  1. Thread: help with array

    by Cornix
    Replies
    10
    Views
    1,089

    [SOLVED] Re: help with array

    Because you are still trying to access invalid array indices.

    You use the variable diceTotal as an index into the array, but you arlready said it yourself:

    But if 10 is the last entry in your...
  2. Thread: help with array

    by Cornix
    Replies
    10
    Views
    1,089

    [SOLVED] Re: help with array

    If the first one is 0 and the last one is 11 you got 12 elements, but you want to store 11 elements.
    So the first position is 0 and the last position is 10. (thats an array of size 11)

    If you are...
  3. Thread: help with array

    by Cornix
    Replies
    10
    Views
    1,089

    [SOLVED] Re: help with array

    Look at these 2 lines and think very carefully:

    int diceTotal = dieOne+dieTwo;
    tally[diceTotal]++;
    What values can diceTotal have? What is possible and impossible?
    How many elements are you...
Results 1 to 3 of 3