how the memory is allocated?

Reply

Join Date: Mar 2007
Posts: 45
Reputation: satish.paluvai is an unknown quantity at this point 
Solved Threads: 1
satish.paluvai satish.paluvai is offline Offline
Light Poster

how the memory is allocated?

 
0
  #1
Apr 5th, 2007
Memory allocation of variables declared in a program is ------
a) Allocated in RAM
b) Allocated in ROM
c) Allocated in stack
d) Assigned in registers.
which one is correct please tell me the answer in 24 hrs...
Reply With Quote Quick reply to this message  
Join Date: Aug 2006
Posts: 254
Reputation: jan1024188 is an unknown quantity at this point 
Solved Threads: 2
jan1024188's Avatar
jan1024188 jan1024188 is offline Offline
Posting Whiz in Training

Re: how the memory is allocated?

 
0
  #2
Apr 5th, 2007
In RAM .... Is this a homewrk?
Reply With Quote Quick reply to this message  
Join Date: Mar 2007
Posts: 21
Reputation: desijays is an unknown quantity at this point 
Solved Threads: 1
desijays desijays is offline Offline
Newbie Poster

Re: how the memory is allocated?

 
0
  #3
Apr 5th, 2007
Originally Posted by satish.paluvai View Post
Memory allocation of variables declared in a program is ------
a) Allocated in RAM
b) Allocated in ROM
c) Allocated in stack
d) Assigned in registers.
which one is correct please tell me the answer in 24 hrs...
both a and c are correct in a way. Memory allocation of variables is logically stored on the stack which in turn is physically stored on RAM although there is no stack structure whilst stored in RAM. Sometimes d is also right.

If optimization needs to be performed then the same variable might get a place in the register.
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:


Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC