• 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 statement
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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.

References: 
 >is there something with the switch statement (From: Theodore Petrosky <email@hidden>)

  • Prev by Date: Re: NSTableView fontsize
  • Next by Date: Re: Document App or not?
  • Previous by thread: is there something with the switch statement
  • Next by thread: Document App or not?
  • Index(es):
    • Date
    • Thread