R
ranjeet.gupta
Dear All.
As far as i know that Then memeory is divided into the three segements
1. Heap;
2. Stack;
3. Data segmnet;
But I am not getting the exact picture of the diffrence and the
behaviour
of these, Can any one shed there knowledge on this.
And why we get the stack over flow ? As if I write a simple
code
int main () {
int (*main_ptr) (void);
main_ptr = main;
printf("%s\n", Hi);
(*main_ptr)();
return 0;
}
Now what are the steps to be considerd while writing the code so that I
may not get the stack over flow (To check there may not be stack over
flow)
Thnaks In Advance
Regards
Ranjeet
As far as i know that Then memeory is divided into the three segements
1. Heap;
2. Stack;
3. Data segmnet;
But I am not getting the exact picture of the diffrence and the
behaviour
of these, Can any one shed there knowledge on this.
And why we get the stack over flow ? As if I write a simple
code
int main () {
int (*main_ptr) (void);
main_ptr = main;
printf("%s\n", Hi);
(*main_ptr)();
return 0;
}
Now what are the steps to be considerd while writing the code so that I
may not get the stack over flow (To check there may not be stack over
flow)
Thnaks In Advance
Regards
Ranjeet