update: Now I re-tested both the simplified test version and the full code with the restored names, and it works correctly. There was probably some other error somewhere else in my code that was now fixed. Sorry for wasting time and effort; will never publish without a working test in the future. Mea culpa.
I have a C ++ function that I call repeatedly. It has the following snippet
switch(c)
{
case 1:
{
static int i = 0;
if ( ... ) { i = 0; }
....
break;
}
case 2:
{
static int i = 0;
if ( ... ) { i = 0; }
....
break;
}
case 3:
{
static int i = 0;
if ( ... ) { i = 0; }
....
break;
}
}
The idea is that she must remember her condition for each case, and sometimes it must reset.
. (MSV++ 2010 Express Edition), , i , , , ; , , if , i = 0; ... !!! "locals" i ( , if). if .
i (i1, i2, i3), .
- - , ? , { ... } . ? C?
: . .