How do I return an Array?
I'm trying to return an array, or a pointer to an array. I've tried everything and cant get it to work. Will somone have a look at my code for me and show me what is wrong.
All I have is a private array and I want to have a method in the class which will return the whole array, not one bit at a time.
Code:
class Board
{
public:
Board(void);
const int** getBoard ();
private:
int theboard[4][4];
};
Board::Board(void)
{
theboard;
}
const int** Board::getBoard ()
{
return &theboard;
}