If I for example have a classed called CardHandler and wanna create a static allocated array of pointers that are of a type called Card and have 40 places, how do I write in the h-file and cpp-file?
I have tried something like this:
class CardHandler
{
private:
Card **arr;
}
CardHandler::CardHandler()
{
this->arr = new Card*[40];
}
But don't think this is the right way? I suspect it's something to do with static.
Card* arr[40]. Note that your are missing the constructor declaration in classCardHandler.