I got a little problem, I get an error:
"C2361: initialization of *identifier* is skipped by 'default' label"
I use an internal class member to set the chosen approach used in my methods.
The methods use this internal member (static int
) with a switch to determine which approach was set.
The switch needs an intial value when compiling, so I decided to use a static const int
. However, VS is still unhappy, and I can't change the static const int
as well.
I am pretty sure this ain't a big deal, but it's quite frustrating.
example:
class test{
public:
static int Val;
static void setVal(int val);
static int doStuff(void);
};
test::setVal(int val){
Val=val;
}
test::doStuff(){
switch(Val){
case 1:
// do stuff
case 2:
// do other stuff
default:
// do default
}
}
Many thanks for any tips or solutions