In C99, the following line of code create a variable ptr on stack which points to a memory region on the heap.
int *ptr = (int*)malloc(sizeof(int)*10);
Where are the definitions of stack and heap? I could not find them in the C99 language specification.
Are the stack and heap defined by the operating system or instruction set architecture or something else?
The another related questions is that whether the concept of stack and heap in C# are exactly the same as the concept in C99? Since C# code are run on the .Net framework, I do not sure if the concept is the same as C99.