Question: (5) Write statements that performs the following tasks. (20 points) (20 points) (a) Declare the variable fooPtr to be a pointer to an object

(5) Write statements that performs the following tasks. (20 points) (20 points) (a) Declare the variable

(5) Write statements that performs the following tasks. (20 points) (20 points) (a) Declare the variable fooPtr to be a pointer to an object of type int and initialize the pointer to nullptr. (b) Declare a variable fool of type int initialized to 8. Further, assign the address of fool to fooPtr. (c) Declare a variable foo2 of type int, initialized to the object pointed to by fooPtr. (d) Add 1 to fool. (e) Display the value of the object pointed to by fooPtr. (f) Display the value of the foo2. (g) Display the boolean value whether the addresses of fool and foo2 are equal. (h) Write the function header for a function called print Bookl which takes two pointers, one to a string book and another to int numPages. This function returns a string. (i) Write the function prototype without parameter names for the function in the previous question. (1) Declare a variable intPtr to be a pointer to an int object which is constant.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock

h part stringprintBook1stringbookintnumPage... 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!