creating objects in c++
what exactly are the differences in the following??
like to create a array of XX objects is
What does it mean by the following?
1. creating an array of XX object pointers
2. dynamic array of XX objects
3.dynamic array of XX object pointers
how can you create a Dynamic 'array'???
pl help me out
mens that memory is reserved in comile time not run time. So you cannot change length of array in runtime;
dynamic array of XX object pointers
XX *obj =new XX;
means that memory is allocated in run time so you can ask user to enter number of objcets for example N and reserve memory for N objects on heap
XX *obj =new XX[N];
is something like this:
XX **obj =new XX*[N];
Dynamic allocation implies allocating/deallocating memory at runtime.