Hi,
This question may have been asked before, but I would like some further clarification. Is it always correct to declare a constant this way?
Code:
class A
{
private:
static const float var;
}
const float A::var = 1.2f;
What I want is:
1) a constant that can be used by class A member functions
2) only one copy is created
3) Basically to replace #define in C.
I know you can initialize const integral in class, but I am looking for a standard way to declare const var that can be used for array/float etc.
Thanks.