I have declarated this:
const int peasant = 300;
const int footman = 900;
const int archer = 500;
const int griffon = 1500;
const int hero = 10000;
const int space = 0;
int Field[10][12];
And now my array Field[][] is filled with the declarated consts and I have a function to print is but in more appropriate view:
void Battlefield::PrintField()
{
string piece;
for (int i = 0; i < 10; i++)
{
cout << endl;
for (int j = 0; j < 12; j++)
{
switch (Field[i][j])
{
case 0: piece = " - "; break;
case space: piece = " "; break;
case peasant: piece = " P "; break;
case -peasant: piece = " EP "; break;
case archer: piece = " A "; break;
case -archer: piece = " EA "; break;
case griffon: piece = " G "; break;
case -griffon: piece = " EG "; break;
case footman: piece = " F "; break;
case -footman: piece = " EF "; break;
case hero: piece = " H "; break;
case -hero: piece = " EH "; break;
}
It gives me back that space, peasant, etc cannot be used in a constant expression
It would probably help if you showed the complete class definition and implementation.
Part of your problems seem to be that you are using C++11 constructs but are not using a C++11 compiler.
Oh and never rely on Intellisense errors, always compile your code and refer to the actual compile errors. Intellisense has is known to be wrong in many occasions.