Hello,
I am re-engineering someone elses code and have come across some code I don't really understand.
To keep it simple I have just displayed the code snippets.
I have a class called Board
Code:
class Board
{
private:
Board *_boards[10];
public:
Board* const* boards() const;
.
.
.
};
Board* const* Board::boards() const
{
return _boards;
}
Now I have another a cpp file that using this class.
I have this code which I find hard to understand.
Code:
Board *board = static_cast<Board*>(boards()[i]);
I don't know why there is a [i] at the end of the boards() function?
Any advice would be most gratefull,
Thanks,