Reputation: 930
A.h
class A {
enum E {one , two , three};
struct B {
char a;
E num;
};
static const B arr[];
}
A.cpp
const B A::arr[] = {
{'1', one},
{'2', two},
{'3', three}
};
I get the following error while compiling: 'B' does not name a type
Upvotes: 1
Views: 271
Reputation: 227370
B
is defined in the scope of A
, so you need to refer to it by its full name:
const A::B A::arr[] = { ....
Upvotes: 6