static int num=2; //why is this a error
static const int cnum=3;//while this is perfectly fine
Why cannot i initialize "static int num" inside a class while am able ti initialize "static const int cnum".
Because in case of in-class initialization of mutable variable, there is no way to determine who is going to be responsible for it's initialization between all users of header file.
Initialization of const static variables inside class declaration was forbiden too until C++11.