views:

101

answers:

1

Possible Duplicate:
What C++ pitfalls should I avoid ?

What is the most common mistake in C/C++programming that you keep committing or see most of the people do? Being aware of it atleast subconsciously will increase my or anyone's chances of committing it.

A: 

Wrong memory management in all kinds of ways - new without delete, delete on the wrong pointer, unclear ownership of a pointer with resulting memory allocation / deallocation problems etc.

Doc Brown
Using `delete` anywhere other than an RAII container is almost always a major mistake.
James McNellis