Thread: array question

  1. #1
    Registered User
    Join Date
    Mar 2014
    Posts
    1

    array question

    array question-array-jpg

    Can anyone help me understand this question ..

    From my understanding it has a loop i which has zero value and it says increase 0 by 1 till it reaches less than 10 value .

    but i cant understand the last time , also the answer is below to the question which i cant understand .

  2. #2
    Registered User
    Join Date
    Jun 2005
    Posts
    6,815
    That depends on the caller. If the caller passed an array with only 10 elements, A[10] does not exist, so accessing A[10] causes undefined behaviour. If the caller passed an array larger than 10 elements, with the first 10 initialised as described, then all is fine.
    Right 98% of the time, and don't care about the other 3%.

    If I seem grumpy or unhelpful in reply to you, or tell you you need to demonstrate more effort before you can expect help, it is likely you deserve it. Suck it up, Buttercup, and read this, this, and this before posting again.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. A question about array
    By unknownC in forum C Programming
    Replies: 7
    Last Post: 10-18-2011, 04:19 PM
  2. Replies: 12
    Last Post: 11-21-2010, 09:46 AM
  3. Array question
    By beon in forum C Programming
    Replies: 1
    Last Post: 11-30-2006, 03:21 AM
  4. Array question..
    By snapshooter in forum C++ Programming
    Replies: 14
    Last Post: 11-24-2004, 09:06 AM
  5. Array question
    By campermama in forum C++ Programming
    Replies: 5
    Last Post: 06-04-2004, 10:04 AM