Question: Exercise 2 : Some errors in the use of pointers Find the error in each of the following program segments and give a corrected version.
Exercise : Some errors in the use of pointers
Find the error in each of the following program segments and give a corrected version. Given the following declarations
and statements.
int xPtr; xPtr will reference array z
int number;
int z;
a Assign the address of z in xPtr
xPtr
b use pointer to get second value of array z
number xPtr
c assign the fifth element of the array z
number xPtr;
dprint the entire array z
int i;
fori ;i ; i printfd
xPtri;
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
