Question: Hello, this is for programming in C++ . Below is the assignment, it deals with pointers and I am a bit lost on them so

Hello, this is for programming in C++. Below is the assignment, it deals with pointers and I am a bit lost on them so please help. Please include your thought process. Thank you very much.
 Hello, this is for programming in C++. Below is the assignment,

Memory Leaks and Dangling Pointers Given the declarations int *ptrA, *ptrB; Tell whether each code segment below results in a memory leak, a dangling pointer, or neither Draw pictures to help 1. ptrA-new int; ptr-new int; *ptrA = 345 2, ptrA = new int; ptrA 345; delete ptrA; 3. ptrA new int; ptrA 345; ptrB # new int; ptrB*ptrA; 4, ptrA new int ; ptrA 345; ptrB new int; 5. ptrA LocationOfAge where function LocationofAge is defined as: int LocationOfAge) int age21; return kage

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock 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 Databases Questions!