R
Rakesh Sinha
I am having this code here.
static const float PI = 3.14159;
static const float INC = 0.4f * PI;
When I compile my program, I get the following error,
error: `MyClass:I' cannot appear in a constant-expression .
I was wondering why this is not possible here. May be is it because
there is no guaranteed order of initialization among C++ members ?
But when, intuitively, I had defined PI here, and then use PI later in
a subsequent definition. Would it not be possible to use PI
here,(since i can't change PI anymore ) ?
static const float PI = 3.14159;
static const float INC = 0.4f * PI;
When I compile my program, I get the following error,
error: `MyClass:I' cannot appear in a constant-expression .
I was wondering why this is not possible here. May be is it because
there is no guaranteed order of initialization among C++ members ?
But when, intuitively, I had defined PI here, and then use PI later in
a subsequent definition. Would it not be possible to use PI
here,(since i can't change PI anymore ) ?