Documentation
Output
Value stored in dynamically allocated memory: 25
Important Points
-
newallocates memory at runtime -
Memory allocated by
newmust be freed usingdelete -
ptrstores the address of dynamically allocated memory -
*ptraccesses the value stored in memory