Tuesday, January 13, 2009

Learnings of the Week (ROLLORATA)

[ ARRAY ]

In computer science, array programming languages (also known as vector or multidimensional languages) generalize operations on scalars to apply transparently to vectors, matrices, and higher dimensional arrays.
  • An array is a variable name that is associated with a number of adjacent locations in RAM.
  • If the name of the variable is, for example, StudentQuizScores, individual values within the array are accessed via an array index, or just index using a syntax something like:
     StudentQuizScores[i]
    which means the i-th element/value in the array "StudentQuizScores".
  • The array name plus index notation is treated just like a regular variable in the programming syntax. E.g.,
     StudentQuizScores[i] = StudentQuizScores[i] + Quiz4Score;
  • Depending on the particular programming language, the index associated with the very first element in an array might have the value 1 or 0 (most modern ones use 0).

No comments: