Lesson 2: Arrays and Pointers Flashcards
An ordered set consisting of a variable number of elements to which additions and deletions may be made
List
A list which displays the relationship of physical adjacency
Linear list
A finite sequence of simple data items or records
Linear list
An ordered collection of data items of the same type referred to collectively by a single name
Array
Individual data items in an array are called __________
elements
Array elements are ordered according to subscripts, and sometimes called as ___________
Subscripted variables
A variable that holds the memory address of another variable
Pointer
The datatype of both, the pointer variable and the variable whose address is being assigned to a pointer variable, must be ___________
same
Declaration of Array
int a[5];
Declaration of Pointer
int *p;
Differences of Pointer and Array (clue: OSV)
&operator
sizeof operator
reassigning a VALUE
[Differences of Pointer and Array] &operator
&pointer = returns the address of pointer
&array = returns the address of first element
[Differences of Pointer and Array] sizeof operator
sizeof(array) = returns the total memory consumed by the all the elements of the array
sizeof(pointer) = returns the only memory consumed by the pointer variable itself
[Differences of Pointer and Array] reassigning a value
Array variable can’t be re-assigned a value whereas pointer variable can
The number of subscripts of an array determines its __________
Dimensionality