I tried to init char[][] static public field in class but in another function this field is undefined. How I use consexpr or exists another method to init static (dictionary) array?
class A {
public:
constexpr static char dict[][3] = {
"a",
"bb"
};
void print() {
printf(A::dict[1]);
}
};
int main() {
A a;
a.print();
return 0;
}
10 undefined reference to `A::dict'