Hi guys,
How do I pass arguments into into the constructor if I'm using new to creat an array of objects?
So for example:
CParticle* parts;
parts = new CParticle[100];
parts is declared globally, but initialised later on in the code..
my lecturer suggested this strange syntax:
parts = new CParticle[100] = { CParticle(arg1), CParticle(arg2), ... };
He mentioned something about how this creates a temporary object and gets the constructor arguments from it.. but this was on a blackboard and when I tried it at home it didn't work.. I don't want to bother him again...
Any help is greatly appreciated!