Advertisement
Sinux1

Topic 7 arrays

Apr 5th, 2016
92
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.57 KB | None | 0 0
  1. Topic 7
  2. Slide 2
  3.  
  4. Array - A variable that can store many values.
  5.  
  6. There is a physical limit but as far as software there is no limit
  7.  
  8. example
  9.  
  10. my_friends[5]; // number in hard brackets represents size of array,
  11. there are five elements in this example.
  12. To access individual cells you use their 'index'
  13. Ex. Cells are 0-4 in this case. First cell is 0
  14.  
  15. my_friends[0] = 'Sam'; // Assigns the value ""Sam" to the first index in this array
  16.  
  17. When declaring an array you must state the size
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement