Question: Find the error in the following code and explain why? int x = 99; const int* p = &x; const int* p2; int* const

Find the error in the following code and explain why? int x = 99; const int* p = &x; const int* p2; int* 

Find the error in the following code and explain why? int x = 99; const int* p = &x; const int* p2; int* const pc2; int y = *p; *p2 = 5; p2 = p; P = &y; P = p + 1; int *p3= p; int const p4 = p; const int const p5 = p; int *z p5; 6. Question 6: Write a function that takes a pointer that points to an int array as param, and it makes that pointer point to the first zero. For example: int array [] = {8,5,3,9,3,0,3,1,0,4,8); int *p = array; pointsToFirstZeor (p) ; cout < < *p; //0 cout < < * (p + 1); //3 cout < (p + 2); //1

Step by Step Solution

3.56 Rating (160 Votes )

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock

The image you have provided contains a snippet of C code with several declarations and operations involving pointers and youve asked to find an error ... View full answer

blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Algorithms Questions!