I am using Xcode 4.0.2 for an iOS4 project.
I have a standard switch statement
switch (i) { case 0: int a = 0; break ... }
This will give me the "Expected Expression" error on int a = 0 ;.
Itβs very strange that βSwitchβ works fine if I precede a type declaration with a simple statement like
switch (i) { case 0: b = 0; int a = 0; break ... }
in this case, the compiler does not give an error (only the warning "unused variable a").
How can it be?
Thanks.
boscarol
source share