Question: Create 4-element built-in array. Set a pointer to point nPtr to the built-in array. Output built-in array using array subscript notation. Output built-in array using
Create 4-element built-in array. Set a pointer to point nPtr to the built-in array. Output built-in array using array subscript notation. Output built-in array using array name and pointer/offset notation. Output built-in array using nPtr and array subscript notation.
Output built-in array using nPtr and pointer/offset notation.
Sample run:
Array numbers displayed with:
Array subscript notation numbers[0] = 100
numbers[1] = 200
numbers[2] = 300
numbers[3] = 400
Pointer/offset notation where the pointer is the array name *(numbers + 0) = 100 *(numbers + 1) = 200 *(numbers + 2) = 300 *(numbers + 3) = 400
Pointer subscript notation nPtr[0] = 100 nPtr[1] = 200 nPtr[2] = 300 nPtr[3] = 400
Pointer/offset notation *(nPtr + 0) = 100 *(nPtr + 1) = 200 *(nPtr + 2) = 300 *(nPtr + 3) = 400
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
