we have defined variables with in the insertathead class which are dynamically allocated but here they are not being thrown with a head allocation error which occurs when we do not delete the dynamically allocated memory
Why are we not deleting the dynamically allotted variables anywhere and the programs is not giving errors
hey deleting the dynamically allocated memory is not a compulsion.
it will not throw any error if the memory is not deleted
its just a good practice to delete it
but like for small code like ours the memory allocation are not so much hence without deleting the memory is sufficient
I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.
On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.