Hi everyone. I have this class...
Code:
class ApplicationType
{
private:
vUIButton Buttons[5];
public:
ApplicationType();
...
};
and I need the constructor of this ApplicationType to set up all my buttons. The buttons' constructors look like this:
Code:
vUIButton( char* Text, RectangleType* Area )
(So normally I would make a button by saying "vUIButton ExitButton( "Exit", NULL );".)
How do I do this with an array? I want the buttons to be like this:
1. "New", NULL
2. "Load", NULL
3. "Options", NULL
4. "Credits", NULL
5. "Exit", NULL
I know that i could do it like this...
Code:
vUIButton Buttons =
{
vUIButton( "New", NULL ),
vUIButton( "Load", NULL ),
vUIButton( "Options", NULL ),
vUIButton( "Credits", NULL ),
vUIButton( "Exit", NULL )
};
...but this won't work in the constructor.
How do I use an array's objects' constructors in the constructor of the class that contains them? (Wow, that was a weird sentence...)
Thank you very much for your time. It is greatly appreciated!