forum.venkateswarlu.net
      Register      Login
what is mean by dynamic array..

2 replies to this topic

P.RAMASAMY PERUMAL #1
Member
30 Points
Posted on 10 Apr 2012 07:08 PM IST What is mean by dynamic array..
 
Dot Net     635 views     Reply to this topic
Ram Jee #2
Member
12 Points
Replied on 17 Apr 2012 11:25 AM IST Static arrays are created on the stack, and necessarily have a fixed size (the size of the stack needs to be known going into a function):

int foo[10];

Dynamic arrays are created on the heap. They can have any size, but you need to allocate and free them yourself since they're not part of the stack frame:

int* foo = new int[10];
delete[] foo;

You don't need to deal with the memory management of a static array, but they get destroyed when the function they're in ends
 
Reply to this topic
Dhamodharan R #3
Member
24 Points
Replied on 17 May 2012 09:23 AM IST Hi

Please refer this link  
Reply to this topic