954,480 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

Why use Dynamic and Static Memory Allocation...

First how do you use Dynamic and Static Memory Allocation?

and why is supposed to be so popular in use?

Fasola
Junior Poster
188 posts since Jan 2005
Reputation Points: 11
Solved Threads: 0
 
char a[256]; // Static allocation
char *p = new char[256]; // Dynamic allocation

>and why is supposed to be so popular in use?
You aren't restricted to a "one size fits all" strategy, and you can generally grab more memory from the dynamic pool than from the "stack".

Narue
Bad Cop
Administrator
15,460 posts since Sep 2004
Reputation Points: 6,464
Solved Threads: 1,401
 

^^^

i am really starting to like you :)

thanx again

Fasola
Junior Poster
188 posts since Jan 2005
Reputation Points: 11
Solved Threads: 0
 

This is fucking LOLs

umair100
Newbie Poster
1 post since Jun 2010
Reputation Points: 9
Solved Threads: 0
 

This question has already been solved

Post: Markdown Syntax: Formatting Help
You