« Return to Thread: using BREAK in 'C'

Re: using BREAK in 'C'

by Peter Restall :: Rate this Message:

Reply to Author | View in Thread


On Sun, 28 Jun 2009 12:23:22 -0300, Gerhard Fiedler wrote:

> To break out /only/ of the sequence of statements between the last and
> the next case you could use a 'goto case N' statement (if you jump to
> the next case).

I can see what you're getting at here.  But this has raised a minor question
though; I was unaware that such a 'goto case N' statement existed in C (at
least in ANSI C).  I've just tried it with GCC (-ansi -Wall -pedantic) and
it doesn't like it - I've tried it without those flags too and it's not
having any of it.  It's perfectly legal to have a label within a 'case'
though, and do a 'goto' on that; don't think I've ever had the need to though.
Which C compiler are you using - does one of the PIC compilers have this
syntax variation ?

Regards,

Pete Restall
--
http://www.piclist.com PIC/SX FAQ & list archive
View/change your membership options at
http://mailman.mit.edu/mailman/listinfo/piclist

 « Return to Thread: using BREAK in 'C'