In C99, the following line of code creates the ptr variable on the stack, which points to the area of โโmemory on the heap.
int *ptr = (int*)malloc(sizeof(int)*10);
Where are the stack and heap definitions? I could not find them in the C99 language specification.
Are the stack and heap specific to the architecture of the operating system or set of instructions or something else?
Other related questions are whether the concepts of stack and heap in C # are exactly the same as the concepts in C99? Since C # code runs in a .Net framework, I'm not sure the concept is the same as C99.
c stack heap c #
mingpepe
source share