Article View: comp.lang.c
Article #144Re: Taming The Switch-Statement
From: Janis Papanagnou
Date: Sat, 10 Oct 2026 21:16
Date: Sat, 10 Oct 2026 21:16
19 lines
2353 bytes
2353 bytes
On 2026-10-10 22:53, bart wrote: > On 10/10/2026 21:33, Janis Papanagnou wrote: >> On 2026-10-10 22:03, Michael S wrote: >>> >>> The cases where I want to break out of the loop from the switch in the >>> body of the loop are very common. >> >> Ah, so you'd have needed something like Kornshell's 'break 2' to leave >> more than one level. - I suppose, you needed to used a 'goto' instead >> (and avoid the 'break' completely for those cases). > No, there is only one level of loop here. But you can't use 'break' > because it is doing double duty as a hack to get out of the middle of a > switch statement. Re-read my post and try to understand what I wrote. - Good luck! Janis
Technical Details
Message-ID:
<11aea06$cjm0$6@dont-email.me>Path:
mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!eternal-september.org!feeder.eternal-september.org!nntp.eternal-september.org!.POSTED!not-for-mailReferences:
<119qf6l$2rmg3$1@dont-email.me> <11ac0mi$19kfd$1@dont-email.me> <11ac2jv$1a84t$1@dont-email.me> <11ac783$1bkuo$1@kst.eternal-september.org> <11ad5eq$1l8hg$1@dont-email.me> <11ad9fg$cjm0$4@dont-email.me> <11addhr$1oakb$1@dont-email.me> <11aduuk$cjlv$1@dont-email.me> <20261010220212.000063fd@yahoo.com> <11ae56o$cjlv$4@dont-email.me> <20261010230355.00005189@yahoo.com> <11ae7eb$cjlv$6@dont-email.me> <11ae8k3$2302a$1@dont-email.me>Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!eternal-september.org!feeder.eternal-september.org!nntp.eternal-september.org!.POSTED!not-for-mail From: Janis Papanagnou <janis_papanagnou+ng@hotmail.com> Newsgroups: comp.lang.c Subject: Re: Taming The Switch-Statement Date: Sat, 10 Oct 2026 23:16:54 +0200 Organization: A noiseless patient Spider Lines: 19 Message-ID: <11aea06$cjm0$6@dont-email.me> References: <119qf6l$2rmg3$1@dont-email.me> <11ac0mi$19kfd$1@dont-email.me> <11ac2jv$1a84t$1@dont-email.me> <11ac783$1bkuo$1@kst.eternal-september.org> <11ad5eq$1l8hg$1@dont-email.me> <11ad9fg$cjm0$4@dont-email.me> <11addhr$1oakb$1@dont-email.me> <11aduuk$cjlv$1@dont-email.me> <20261010220212.000063fd@yahoo.com> <11ae56o$cjlv$4@dont-email.me> <20261010230355.00005189@yahoo.com> <11ae7eb$cjlv$6@dont-email.me> <11ae8k3$2302a$1@dont-email.me> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Injection-Date: Sat, 10 Oct 2026 21:16:54 +0000 (UTC) Injection-Info: dont-email.me; logging-data="413376"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19EPrUBH6nVYsuBQx8hhTk/"; posting-host="51a9598490edb80150aa60ca9e0cee6b" User-Agent: Mozilla Thunderbird Cancel-Lock: sha1:DfR0yl8tofhSHWrdrIr4lkAWEys= sha256:poIdVdGtPo5rPy/vKP4ea1N3qdnPouqMB4TacvR5nG8= sha1:RVlV+aFdmqX9zIRiyEwF5WYan54= sha256:6G77YzBFtY/AlYfNVB1X+3X80ZJj81/HG2pj/HugGpk= Content-Language: en-US In-Reply-To: <11ae8k3$2302a$1@dont-email.me>