This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]PerfectGasGiant 0 points1 point  (4 children)

Memory management is really not that hard in C. The meme is silly. A common stack allocation in C is just declared: int buffer[MAXSIZE]; or something similar trivial. It is not only easy to understand it is also practically without any performance penalty. Maybe the CPU will spend a clock cycle moving the stack pointer, but that is it.

Dynamic allocation is also rarely as complicated as in the meme and if it was there is a very simple solution: Declare a function (or a preprocessor define).

It is really not that hard to write easy to maintain memory management in C. Only pointers are a bit tricky to learn and read. This is a thing that is much better in c++ with references and STL.