• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: is there something with the switch
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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.

  • Prev by Date: Re: NSTableView fontsize
  • Next by Date: Re: Bindings using other collections?
  • Previous by thread: Re: Characters with accents in NSString
  • Next by thread: Sending a HTTP form (searching the right framework/class-library)
  • Index(es):
    • Date
    • Thread