I have defined a class,
As part of the main program, the number of instances of the class I want to create is entered by the user, how can I create all these instances of the class, each with a different name e.g. K1, K2, K3 etc.
What I have at the moment is, nocharge is the number of instances I want to create, and Cpointcharge is the name of the class, but this doesn't work. I need some help:
for (int i = 0; i <= nocharge; ++i)
{
Cpointcharge K[i];
}
thanks (I've only been programming for a couple of weeks so its probably something fairly simple).
2007-01-30
07:56:30
·
3 answers
·
asked by
Om
5