Re: is there something with the switch
Re: is there something with the switch
- Subject: Re: is there something with the switch
- From: Theodore Petrosky <email@hidden>
- Date: Sun, 8 Feb 2004 09:45:18 -0800 (PST)
Thanks.... Is this the 'spec'? I don't see this used
like this anywhere else, or maybe I am not looking
hard enough....
I guess I will just use the {} all the time in the
case statement. Then I won't have to think about it.
Ted
>
Message: 12
>
Cc: email@hidden
>
From: lbland <email@hidden>
>
Subject: Re: is there something with the switch
statement
>
Date: Sun, 8 Feb 2004 11:43:29 -0500
>
To: Theodore Petrosky <email@hidden>
>
>
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;
>
}
__________________________________
Do you Yahoo!?
Yahoo! Finance: Get your refund fast by filing online.
http://taxes.yahoo.com/filing.html
_______________________________________________
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.