Re: Initialize an array of classes?
- From: "Bob Altman" <rda@xxxxxxxxxxxxx>
- Date: Wed, 30 Jul 2008 13:05:01 -0700
Well, I found a way to get kind of what I'm after. Instead of trying to
have an array of class instances, I can create an array of pointers to class
instances. That way I can use the "new" operator in the body of the
constructor to initialize the array. Of course, this means that I need to
go through my code and change all of the relevant "." operators to "->"
operators, but that's easily enough done in this case.
But I'm still curious as to whether or not it's possible to initialize an
array of classes if the class doesn't have a default constructor.
.
- Follow-Ups:
- Re: Initialize an array of classes?
- From: "Charles Wang [MSFT]"
- Re: Initialize an array of classes?
- From: Bo Persson
- Re: Initialize an array of classes?
- References:
- Initialize an array of classes?
- From: Bob Altman
- Re: Initialize an array of classes?
- From: Bob Altman
- Initialize an array of classes?
- Prev by Date: Re: Timer and GDI+ Window Update
- Next by Date: Re: Initialize an array of classes?
- Previous by thread: Re: Initialize an array of classes?
- Next by thread: Re: Initialize an array of classes?
- Index(es):
Relevant Pages
|