Question: Find the error in each of the following program segments. Assume 6. int *zPtr; // zPtr will reference array z int *aPtr = NULL;

Find the error in each of the following program segments. Assume 6. int *zPtr; // zPtr will reference array z int *aPtr = NULL; void *sPtr = NULL; int number, i; int z[ 5] = { 1, 2, 3, 4, 5 3; sPtr = z; a) ++zptr; b) // use pointer to get first value of array assume zPtr is initialized number = zPtr; c) // assign array element 2 (the value 3) to number; assume zPtr is initialized number = *zPtr[ 2 ]; d) // print entire array z; assume zPtr is initialized for (i = 0; i
Step by Step Solution
3.52 Rating (162 Votes )
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
Document Format (2 attachments)
636aec3261989_243385.pdf
180 KBs PDF File
636aec3261989_243385.docx
120 KBs Word File
