07
Dec
What if I forget the [] when deleteing array allocated via new T[n]?
Related Blog Items
- Differences between new, malloc; delete, free
- Max Sum between two array indexes
- C++ Basics Tutorial - Lesson 4
- Size of an empty class
- Printing array spirally - recursive routine
All life comes to a catastrophic end.
It is the programmer’s ?not the compiler’s? responsibility to get the connection between new T[n] and delete[] p correct. If you get it wrong, neither a compile-time nor a run-time error message will be generated by the compiler. Heap corruption is a likely result. Or worse. Your program will probably die.
source:Usenet
Popularity: 5%
You need to log on to convert this article into PDF
Related Blog Items - Differences between new, malloc; delete, free
- Max Sum between two array indexes
- C++ Basics Tutorial - Lesson 4
- Size of an empty class
- Printing array spirally - recursive routine
Related Blog Items
- Differences between new, malloc; delete, free
- Max Sum between two array indexes
- C++ Basics Tutorial - Lesson 4
- Size of an empty class
- Printing array spirally - recursive routine
No Comments
No comments yet.