Allocation

Memory allocation is the process of dedicating a deliberate amount of space to a specific purpose or task within a program.

Static allocated memory can be referred to as static, fixed, compile-time or stack.

Dynamic allocated memory can be referred to as dynamic, run-time or heap.

Static allocation is always safer, because the size and lifetime of the memory is known at compile time, reducing the risk of errors such as memory leaks, vulnerabilities or data corruption (e.g. buffer overflows).