The stack and the heap
Local variables live on the stack and vanish when their function returns. malloc gives you heap memory that stays until you free it.
Code
Inside: an interactive visualisation, 2 short explanations, a runnable example and 1 checked exercise.
See what’s includedAlready have Brainlag Code? Sign in