[Home]  [Edit this page]  [Recent Changes]  [Special Pages]  [Help
Array

(general) Array

A way of storing multiple values in memory that can be accessed by index.

For example, if you want to store 5 values, you can each give them a different variable name:
PSEUDOCODE EXAMPLE
  value1 = 1
  value2 = 2
  value3 = 3
  value4 = 4
  value5 = 5


If you want to multiply all values, you will need to call all 5 variable names again:
PSEUDOCODE EXAMPLE
  value1 = value1 * 2
  value2 = value2 * 2
  value3 = value3 * 2
  value4 = value4 * 2
  value5 = value5 * 2
Doing much more math on them is cumbersome. An array can store these values and access them by their index in the array. This way, you can use a loop to do math with these values:
PSEUDOCODE EXAMPLE
  MyArray[5] = 1,2,3,4,5
  for index = 1 to 5 
    MyArray[index] = MyArray[index] * 2


Arrays in specific languages



last edited (November 7, 2007) by bilderbikkel, Number of views: 2935, Current Rev: 5 (Diff)

[Edit this page]  [Page history]  [What links here]  [Discuss this topic]  [Printer Friendly]  

Members

Username:

Password:


Register
Forgot Password?




Programmers Heaven - for .NET, Java, C/C++ and WEB Developers!
© 1996-2008 Community Networks Ltd. All rights reserved. Reproduction in whole or in part, in any form or medium without express written permission is prohibited. Violators of this policy may be subject to legal action. Please read Terms Of Use and Privacy Statement for more information. Development by Tore Nestenius at .NET Consultant - Synchron Data.