Nagy Robi Nagy Robi - 10 days ago 7
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;
};

Answer

Macro expands to

int szj[200;]; 

which is not valid C++ code.

remove ; from #define MAX_SZAMJEGY 200;