Array

From Valve Developer Community
Revision as of 16:43, 14 July 2005 by TheJ89 (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

Arrays are a set of variables of the same type with a built in capacity.

An example of an array is below:

   int lotsOfInts[100]

This declares an integer array, with at maximum 100 members.

Strings can be created by making a character array, as seen below.

   char thisIsAString[5]
   thisIsAString[0]="H"
   thisIsAString[1]="e"
   thisIsAString[2]="l"
   thisIsAString[3]="l"
   thisIsAString[4]="o"

Array members can also be accessed via pointers.

Custom classes can be used in arrays.

Vectors are an alternative to arrays.

Stub

This article or section is a stub. You can help by expanding it.