Stack variables
Stack variables
Stack variables are variables that were created locally
For example
int c = getchar();
Heap Variables
Heap variables are manually allocated by the programmer
For example
int* intArray = (int*) malloc(sizeof(int) * 2000);
Is an array allocated on the heap
Written on September 15, 2017