Hi everyone, I write a project about a banking system . In homework professor told us that "Your code must not have any memory leaks. You will lose points if you have memory leaks in your program even though the outputs of the operations are correct." How can I check whether my code has memory leak or not?
jacline
0
Newbie Poster
Recommended Answers
Jump to PostCheck variables that you allocated memory on, and make sure you deleted it somewhere else in the code. If you forget to free any memory, that's a memory leak.
Jump to PostHow can I check whether my code has memory leak or not?
- objects allocated memory using 'new' must be deleted.
- anytime you access an array out of bounds
- anytime you try to dereferrence a NULL pointer.
- anytime you leave a dangling pointer, for example:
int* a, …
All 7 Replies
William Hemsworth
1,339
Posting Virtuoso
Clinton Portis
211
Practically a Posting Shark
mrnutty
761
Senior Poster
jacline
0
Newbie Poster
programmersbook
17
Junior Poster
mrnutty
761
Senior Poster
jacline
0
Newbie Poster
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.