0

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.

Community
  • 1
  • 1
SkypeMeSM
  • 3,197
  • 8
  • 43
  • 61
  • 2
    This should be community wiki. – Brian Rasmussen Oct 21 '10 at 06:41
  • 7
    The most common mistake is thinking that there is such a language as "C/C++" and not understanding that C and C++ are fundamentally different languages. – James McNellis Oct 21 '10 at 06:41
  • 3
    @Brian Rasmussen - the option to mark a question as CW has been gone for weeks now. You can flag it to moderators if you think it should be CW. See [this](http://meta.stackexchange.com/questions/67581/community-wiki-checkbox-missing-in-action) meta question and links. – Oded Oct 21 '10 at 06:43
  • 2
    Possible duplicate of [What C++ pitfalls should I avoid?](http://stackoverflow.com/questions/30373/what-c-pitfalls-should-i-avoid) – Chris Schmich Oct 21 '10 at 06:44
  • @james: nice one...I just meant in both C and C++, since any mistake in C applies to C++ as well. – SkypeMeSM Oct 21 '10 at 06:45
  • @brian and chris: Thank you. I had not noticed the other topic. Please consider this topic closed. Thanks people. – SkypeMeSM Oct 21 '10 at 06:46

1 Answers1

0

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
  • 19,739
  • 7
  • 52
  • 88