Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Allocation pointer to an array of objects

Status
Not open for further replies.

borgrulze

Programmer
Apr 4, 2002
11
0
0
IN
Can anyone inform me as to how to dynamically allocate memory for a pointer to an array of objects using new.

The size of the array of objects is only known at run time.
 
don't understand what you really want,
if you want to allocate a pointer,
CSomeClass ** aPointer = new CSomeClass *;

if you wat to allocate an array,
CSomeClass * aPointer = new CSomeClass[100];
 
Long time since I played with C++ in any kind of meaningful way, but I think that a pointer to an array in C++ is actually just a pointer to the first element (in the 0 index pos).

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top