I have a problem while running a program. I am running out of memory.
What I have done is allocated memory dynamically, using "new" and deleted it after finishing it's use using "delete".
But the memory isnt sufficient to run the program. I have talked about this issue with my teacher and they said that there must be memory leak somewhere.
I have tried using valgrind but I dont have any idea how to use it.
Is it better idea to make an object without allocating dynamically? For eg-
in place of doing