View Single Post
  #4 (permalink)  
Old February 5th, 2004, 10:41 PM
Rune Rune is offline
Authorized User
 
Join Date: Feb 2004
Posts: 12
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Let's say I have two decks of cards, it's ten cards in each deck. The first deck is called a, and the other is called b. The first card in each deck is called card number zero, then the last card ( number 10 ) is called card number 9. This is what we call zero based indexes. We start counting from zero, not from number one. So if i = 0 , then a[ i ], is the first card in deck a, and b[ i ] is the first card in deck b. If i = 5, then ( remember that this is zero based, so you have to add one to the number of the index( doing this wrong is often called off by one error ) ) a[ i ] is card number six in deck a, and b[ i ] is card number six in deck b. What you have to do in programming is first to point at the deck that you want a card from, and then say the number of the card. Saying the number first, and then the deck, is making caos. Point at the mountain, and then tell which path/route you wanna climb. It has no meaning, to tell about the path/route if the people that are listening to you, don't know wich mountain you are talking about. So saying i[ a ] has no meaning.
best regards
rune

Reply With Quote