An array would be the usual way to do this.   Makes it way easier to
programmatically go through them all and do something to them.

C++
{
    Car cars[30];
    for(int i=0; i<30; i++)
    {
        cars[i] = new Car();
    }
}

PHP is essentially the same.  Then you get at them with: car[0], car[1],
...

Jeff

On Tue, Aug 19, 2003 at 03:04:26PM -0600, Nick W wrote:
> C++/PHP nube question...
> 
> Say I create class car, and want 30 instances, named car1-car30 (or 
> something). Is it possible to use a for... loop to do that? Better put...how 
> the heck do you do that?
> -- 
> Nick W ([EMAIL PROTECTED])
> Registered Linux User #324288 (http://counter.li.org)
> MSN Messenger: [EMAIL PROTECTED]
> Yahoo: foolish_gambit
> ICQ: 303276221
> Website: www.fromthecrosstothethrone.com
> 

Attachment: pgp00000.pgp
Description: PGP signature

Reply via email to