Mail Archives: djgpp/1997/03/26/05:29:40
Lee Simons wrote:
> I would like to be able to do a:
>
> data[0](100, 99)
>
> sort of thing. Where 100 is the skill as shown in the other example, and
> 99 is the speed.
Create a constructor for class Player that takes two ints, i.e.
Player::Player(int, int). Then declare the array like so:
Player players[1000] = { Player(100, 99),
Player(23, 32),
/* and so on ... */ };
If you truly want to do this on the fly, then you're out of luck, other
than declaring an array of pointers, and then dynamically allocating them.
--
Erik Max Francis, &tSftDotIotE / email: max AT alcyone DOT com
Alcyone Systems / web: http://www.alcyone.com/max/
San Jose, California, United States / icbm: 37 20 07 N 121 53 38 W
\
"I am become death, / destroyer of worlds."
/ J. Robert Oppenheimer (quoting legend)
- Raw text -