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
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
Get step-by-step solutions from verified subject matter experts
