Declaring an array of classes...
It seems that these bits of code don't work:
Code:
CP wPawn('W')[8]; //expected a semi-colon
CP wPawn[8]('W'); //bad array initializer
The class:
Code:
class CP
{
public:
CP(char color);
~CP();
bool isWhite();
private:
char symbol;
bool white;
friend class square;
};
Should I just create a default constructor and declare the color for each individual object through a member function? Apparantly its impossible to define an array like that... If Anyone could tell me why, I would like to know.