Engineering Science 1036A/B Lecture 22: Pointers: Arrays of Pointers

19 views3 pages
The name of an array is the address(pointer) of the first element
When an array is declared, space for all elements in the array is allocated
However when a pointer variable is declared only space sufficient to hold
an address is allocated
The array name is not a pointer variable, but a constant pointer, which always
points to the first element of the array and its value (the address value) can not
be changed.
Declaring an array of pointers:
int *iPtrs[10];
Assigning a value to the first pointer element
iPtrs[0] = #
Output the value of num
cout << *iPtrs[0];
Example
Pointers & Arrays
The array name is not a pointer variable; it’s a constant pointer, which always
points to the first element of the array and its value (the address value) can not
be changed
Arrays of Pointers
Unlock document

This preview shows page 1 of the document.
Unlock all 3 pages and 3 million more documents.

Already have an account? Log in

Get access

Grade+20% off
$8 USD/m$10 USD/m
Billed $96 USD annually
Grade+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
40 Verified Answers
Class+
$8 USD/m
Billed $96 USD annually
Class+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
30 Verified Answers

Related Documents

Related Questions