Title: Arrays
Course: CPS 120: Introduction to Computer Science ~ Master (Aug/2015) OLD > Section: Learning Units

Visual C++ array

- An array is a set of one or more variables grouped together under one name.
- Each variable in the array is called an element.
- Arrays are useful for storing similar types of information.
- Like a variable, an array is created with a declaration.

Array declaration

- Usually appears near the top of a program.
- Defines the name, type, and size of an array.
- Has the form:

type identifier[size];

Statement part | Description
type | Type of values the array will hold.  C++ data types include int, double, string, char, and bool.
identifier | Name of the array.  The same naming rules apply to variable and array names.
size | Size of the array; the number of elements in the array.
; | End of statement.

Activity:

- To review more about how arrays work in C++, revisit this page in tutorialspoint.