where do the automatic variables go ?
- From: sidd <siddharthkumra@xxxxxxxxx>
- Date: Sat, 9 Aug 2008 11:26:53 -0700 (PDT)
In the following code:
int i = 5; ---> it goes to .data segment
int j; ---> it goes to bss segment
int main()
{
int c;
int i = 5; ---> stack
int j[5] = new int[5]; ----> heap
c = i*2; ----> goes to .text segment
}
My question is : When the object file is created there are text, data
and bss segments etc...but there is notthing like stack and heap
segment, what happens to these automatic variables ?
I hope I am making sense.....
Siddharth
.
- Follow-Ups:
- Re: where do the automatic variables go ?
- From: Antoninus Twink
- Re: where do the automatic variables go ?
- From: Bartc
- Re: where do the automatic variables go ?
- From: santosh
- Re: where do the automatic variables go ?
- From: Richard Heathfield
- Re: where do the automatic variables go ?
- Prev by Date: Re: how to find number of bytes freed
- Next by Date: Re: where do the automatic variables go ?
- Previous by thread: Dynamic allocation of multi dimensional array
- Next by thread: Re: where do the automatic variables go ?
- Index(es):
Relevant Pages
|