I have defined a struct in side a class. One of the members is an array with a given size.
class foo {
private:
int N;
struct entry {
uint64_t pc;
uint64_t offset;
bool pattern [N];
};
public:
void bar()
{
entry en;
en.pc = 1;
en.offset = 2;
en.pattern[en.pc] = 1;
}
};
But the error is
error: invalid use of non-static data member ‘N’