Re: is there something with the switch statement
Re: is there something with the switch statement
- Subject: Re: is there something with the switch statement
- From: lbland <email@hidden>
- Date: Sun, 8 Feb 2004 11:43:29 -0500
On Feb 8, 2004, at 10:09 AM, Theodore Petrosky wrote:
does not work with compile errors 'error: parse error
before '*' token'.
so on a lark I added a table reload after the case
statement and it works.
Is this my error?
Look below. Put {} around auto declarations in switch. See ANSI specs
(I think...).
In general, the declaration of a variable can't be conditional within a
given scope ...
-lance
Lance Bland
mailto:email@hidden
VVI
888-VVI-PLOT
http://www.vvi.com
DOES NOT WORK:
/Users/lbland/testApp22/Test1.m:22: error: parse error before "double"
- (void)test
{
int myint;
myint = 3;
switch(myint){
case 0:
double *aa;
*aa = 5;
break;
}
//aa = 5;
return;
}
THIS WORKS:
- (void)test
{
int myint;
myint = 3;
switch(myint){
case 0:
{
double *aa;
*aa = 5;
}
break;
}
//aa = 5;
return;
}
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.