ok, I'm stumped >:(
I get this error on the line just after default:
\Projects\test\main.c(76): error #2157: Unrecognized statement.
\Projects\test\main.c(76): error #2001: Syntax error: expected ';' but found 'iMove'.
\Projects\test\main.c(76): error #2048: Undeclared identifier 'iMove'.
switch (iCliLen)
{
case 1 :
wmemcpy(sArgPtr, sArgPtr+1, iLen2);
sArgPtr[0] = sCli[0];
break;
case 2 :
wmemcpy(sArgPtr, sCli, 2);
break;
default :
// What is wrong with this???
int iMove = iCliLen-2;
for (int x=iLen2+1+iMove; x>=iMove+1; x--)
sArgPtr[x] = sArgPtr[x-iMove];
break;
}
Project was created/written with v8 RC7 but I added the source to a blank project with v7 and attached that one. Same error either way.
Switch doesn't allow local declarations in cases without creating a block scope. Enclose your case code in braces and it will work.
default :
{
int iMove = iCliLen-2;
for (int x=iLen2+1+iMove; x>=iMove+1; x--)
sArgPtr[x] = sArgPtr[x-iMove];
break;
}
ohhhhhhhhhh
ty
Thanks frankie and x79, I hit the same problem a few days back.
I guess we need to unlearn C++ a little bit. 8)