Nagy Robi Nagy Robi - 4 months ago 52
C++ Question

Array declaration inside struct using predefined constant in C++

I want to declare an array inside a structure with a predefined constant size, but it gives me this error : expected a ']'.

#define MAX_SZAMJEGY 200;

struct szam {

int szj[MAX_SZAMJEGY];
bool negative;


Macro expands to

int szj[200;]; 

which is not valid C++ code.

remove ; from #define MAX_SZAMJEGY 200;