| C Tutorial | Disadvantages of being in the heap | |||
|
Advanced C Arrays Plus Syntax Pointer Style and strcpy() Pointer Type Effects Arrays and Pointers Array Names Are Const Heap Memory Memory Management Dynamic Arrays Advantages of being in the heap Disadvantages of being in the heap Dynamic Strings
|
• You have to remember to allocate the array, and you have to get it right.
• You have to remember to deallocate it exactly once when you are done with it, and you have to get that right.
• The above two disadvantages have the same basic profile: if you get them wrong, your code still looks right. It compiles fine. It even runs for small cases, but for some input cases it just crashes unexpectedly because random memory is getting overwritten somewhere like the smiley face. This sort of "random memory smasher" bug can be a real ordeal to track down. Want To Know more with Video ??? Contact for more learning: webmaster@freehost7com |
|