I have the following in my Board.h file:
Now, when I go to Board.cpp, after including the above .h file, and I type "CBoard::", the pop-up menu that appears only contains: Grid, ReturnTile, and ~CBoard. But no Constructor.Code:class CBoard { public: CBoard(); ~CBoard(); int ReturnTile(int X, int Y); protected: int Grid[20][20]; };
When I try to run the program, I get the error:
error C2228: left of '.ReturnTile' must have class/struct/union type
For the following code (Indicated at the *s):
And incase you're wondering, all that the ReturnTile code is:Code:CBoard MyBoard(); int TileReturn; for (int XX = 0; XX <= 20; XX++) { for (int YY = 0; YY <= 20; YY++); { TileReturn = MyBoard.ReturnTile(XX, YY); //***************** } }
But again, I think this all links back to the constructor and it not being recognized. But if you see something else that's causing the problem, I'm all earsCode:int CBoard::ReturnTile(int X, int Y) { return Grid[X][Y]; }
Thanks for reading.
Erik



LinkBack URL
About LinkBacks




