I'm trying to #define a constant at the top of the header file and use that value as the index size of my arrays. I'm getting the following error:
Error C2059: syntax error : ']'
I'm curious as to why?
#define MAX_TEAMS = 20;
class Program
{
public:
int atk_val[MAX_TEAMS]; // Error!
int atk_val[20]; // Works!
}
static const int MAX_TEAMS = 20;instead of#definestatic constas Captiain Obvlious pointed out, or even better use standard containers instead of plain arrays