Hi, Im using namespaces for one of my assignments and its really boggling my mind. Here is my class:
Code:
#ifdef _GAMETREE_
#define _GAMETREE_
// My Namespace
namespace Mastadex
{
// Macros to make my Life Easier
#define BOARDSIZE 30
typedef struct Node
{
Node *Parent; // Pointer to the Parent Board
int BoardValue; // The Value of the board
int BestMove, WorstMove; // Represents a Numerical Value equal to an Index in the Array of Possible Moves
int Board[6][5]; // The Board Itself
Node *NextMove[BOARDSIZE]; // An Array of Pointers to Board Configs
};
class GameTree
{
Node *RootNode; // Root Node
Node *CurrentNode; // Current Node that is being Pointed To
int MoveX; // Recommended Move X
int MoveY; // Recommended Move Y
//int EvaluateBoard(int Board[][6]);
//void ClearTree();
//void CopyBoard(int ToBoard[][6], int FromBoard[][6]);
public:
GameTree()
{
// NOTHING YET
}
~GameTree()
{
// NOTHING YET
}
//void MapBoard(int Board[][6]);
//void RecommendedMove(int &X, int &Y);
};
void GetLocation(int &X, int &Y, int Board[][6])
{
// NOTHING YET
}
}
#endif
Here is My Main:
Code:
#include "header.h"
int main(int argc, char *argv[])
{
int board[5][6];
int loc1, loc2;
Mastadex::GetLocation(loc1, loc2, board);
return 0;
}
In the main, im getting this error at the GetLocation functioncall in VS.NET: error C2653: 'Mastadex' : is not a class or namespace name
Ignore the fact that this class does nothing, im just trying to get it compiling right now. This is my first time dealing with namespaces, I have no idea how to fix this. Help?
EDIT: Im using Visual Studio .NET 7.1