1.11M Members

Static and Dynamic Memory Allocations...Advan's & Disadvan's???

 
1
 

What's the difference between Static and Dynamic Memory Allocation

and what are the advantages and disadvantages of them both?

 
0
 

Static allocation is fast, but set in stone. Dynamic allocation is slower, but you can grab varying chunks. This sounds a lot like a homework question.

 
0
 

nah, its not homework. I've been out of school for almost 2 yrs now and haven't coded in 3. i was reading up on it for this Software Engineer position and i could only find Dynamic Memory Allocation. There was nothing on Static memory allocation. So, i made a thread up. I told you this is going to be a second home for me. Thinking about getting a computer with there's still a flat panel special at Dell

thanx a lot as usual ;)

 
0
 

Static memory allocation is called a bunch of different things, whereas dynamic memory allocation is the term that's used most often for that concept.

 
0
 

>Static memory allocation is called a bunch of different things

hmmmmm...i think i saw something on static data storage. Is that the same thing?


oh i have my answers to that code i put up i'll put it up real soon

*about to type it up now*

 
0
 

It depends on the context. If we're talking about the structure of an executable file, then it's not the same. If we're talking about variables not allocated by new or malloc, then it probably is the same. If we're talking about linkage, then get ready to be confused. ;) I'm still not sure I understand linkage in C and C++. :D

 
0
 

i'm already confused lol

you lost me at >structure of an executable file

but let me type this code up real quick so you can see the answers, i think there was an error in the question they gave me (i'll explain later)

 
0
 

Static allocation is done at the time the program is written. The programmer reserves a set amount of memory for each use. That setting will be used each time the program runs.

Dynamic allocation is done while the program runs, adjusting the amount of memory for each use according to how much memory that use actually needs AT THIS TIME.

 
0
 

:mrgreen:

What's the difference between Static and Dynamic Memory Allocation

and what are the advantages and disadvantages of them both?

You
This article has been dead for over six months: Start a new discussion instead
Post:
Start New Discussion
Tags Related to this Article