Hello. I'm trying to develop a very simple user-based information system. For example, read a folder for .ini files and get the pInfo stuff for each different player. It's for a network game I'm developing.
So here's a BASIC example.
if( PlayerInfo[playerOne][pLeader] == 1 )
{
cout << "Player 1 is the leader of Team 1.";
}
However, things aren't going as I planned. This is my code.
/* Main.cpp
2D Array Test */
//Include & Namespace
#include <iostream>
using namespace std;
//Define's
#define MAX_PLAYERS 32
//playerInfo enum
enum pInfo
{
pLevel = 0,
pMember = 0,
pLeader = 0,
};
int PlayerInfo[MAX_PLAYERS][pInfo];
//Main process
int main()
{
return 0;
}
Here's the errors I get.
1>Compiling...
1>Main.cpp
1>c:\documents and settings\aleksander\my documents\visual studio 2008\projects\2d array test\2d array test\main.cpp(16) : error C2144: syntax error : 'pInfo' should be preceded by ']'
1>c:\documents and settings\aleksander\my documents\visual studio 2008\projects\2d array test\2d array test\main.cpp(16) : error C2144: syntax error : 'pInfo' should be preceded by ';'
1>c:\documents and settings\aleksander\my documents\visual studio 2008\projects\2d array test\2d array test\main.cpp(16) : error C2143: syntax error : missing ';' before ']'
1>c:\documents and settings\aleksander\my documents\visual studio 2008\projects\2d array test\2d array test\main.cpp(16) : error C2059: syntax error : ']'
Is this kind of thing even possible?