class School
{
static const int *classcapacity;
};
This expression is from my exam and it need to get initialized how can i do that ?
class School
{
static const int *classcapacity;
};
This expression is from my exam and it need to get initialized how can i do that ?
Probably this way:
class School{
static const int *classcapacity ;
};
const int *School::classcapacity = 0;
If you want to initialize it with YOUR_INITIALIZER:
class School{ static const int *classcapacity ; } ;
const int* School::classcapacity = YOUR_INITIALIZER;
You can initialize it in your source file, outside of the body of the class, just as you would any other static member variable, i.e.:
const int* School::classCapacity(new int(42));