In (pure)
c, there are two ways to allocate memory:
- Static allocation: static and/or global variables - The size of the space is determined at compile time and allocated when the program is started.
- Automatic allocation: allocated with automatic variables such as function arguments or local variables. (See stack)