Initialize a static member ( an array) in C++
- by Jimmy zhang
I intended to create a class which only have static members and static functions. One of the member variable is an array. Would it be possible to initialize it without using constructors? I am having lots of linking errors right now...
Class A{
public:
static char a[128];
static void do_something();
}
How would you initialize a[128]? Why can't I initialize a[128] by directly specifying its value like in C?
a[128={1,2,3,...};