Question
Pointers Memory deallocation Deallocate the memory of the pointer you just created. Copy the lines you had above to print out the address of the
Pointers Memory deallocation Deallocate the memory of the pointer you just created. Copy the lines you had above to print out the address of the pointer, the content of the pointer and the content of the pointee, on different lines. Where is the pointer pointing to? What is the content of the pointee? You should get a run time error (or garbage values which are even worse) if you followed the instructions correctly. Your error comes from the fact that you are trying to read the value of the memory address which has been released. Comment out the line to print out the content of the pointee, and you should be all right. Assign the null value to your pointer Print the information again. Where is the pointer pointing to? What is the content of the pointee? You will also get a run time error, like before, this time because you are trying to read the value of the memory address 0 (which does not exist). Comment out the line to print out the content of the pointee, and you should be all right.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
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