An array is a contiguous block of memory containing one or more elements of the same type and size. Each element in the array is accessed as a zero-based offset from the start of the array or by using the index [].
Examples:
int a[10]; // allocates memory for 10 integers (e.g., 40 bytes for a 4 byte int).
int x = a[5]; // accesses the 6th element (a[0] is the first element).
int *p = a; // point to start of the array.
p += 5; // advance pointer 5 * sizeof( int ) addresses.
*p = 10; // access the 6th element and assign the value 10.
int d * = new int[*p]; // dynamically allocate an array of 10 elements.
delete [] d; // release dynamic array.
Copyright © 2026 eLLeNow.com All Rights Reserved.