Array expression

How does an array variable indexing expression differ from an array definition size expression?

Is it: array index only for index and array def'n specifies just size right ?
Last edited on
When you define an array you specify the size, the type of the array elements and the name of the array. When the line containing the array definition is executed the array will be created.

When you index an element in the array you access the element in the array that is being stored at a index (position) in the array. When indexing you don't need to know the size of the array as long as the index is not out of bounds (index >= size).
Hi,

An ordinary array must have it's size be a constant and known at compile time, whereas an index expression doesn't have to be constant and can vary through runtime.

:+)
Topic archived. No new replies allowed.