Answered step by step
Verified Expert Solution
Question
1 Approved Answer
(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 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
Step: 1
h part stringprintBook1stringbookintnumPage...Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started