Article View: comp.lang.c
Article #199Re: Taming The Switch-Statement
From: Stefan Ram
Date: Sun, 11 Oct 2026 10:14
Date: Sun, 11 Oct 2026 10:14
24 lines
2576 bytes
2576 bytes
Johann 'Myrkraverk' Oskarsson <johann@myrkraverk.invalid> wrote or quoted:
>I don't see this as a problem with C. This can happen in any program-
>ming language, and code with nested control structures.
I agree. Assuming a "break" will leave an "if" in C is an error
of someone who has not learned C yet and who also did not bother
to look up what he does not know or test his code. And it can
perfectly be reproduced in other languages such as Python:
main.py
while True:
if True:
break # leave the "if"
print( "Success: If was left." )
print( "Failure: While was left." )
output
Failure: While was left.
.
Technical Details
Message-ID:
<break-20261011111215@ram.dialup.fu-berlin.de>Path:
mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!fu-berlin.de!uni-berlin.de!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> <11aeeau$24vgh$1@dont-email.me> <11aefu7$254m6$1@dont-email.me> <FlByS.11178$mPXe.3035@fx06.ams4>Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!fu-berlin.de!uni-berlin.de!not-for-mail
From: ram@zedat.fu-berlin.de (Stefan Ram)
Newsgroups: comp.lang.c
Subject: Re: Taming The Switch-Statement
Date: 11 Oct 2026 10:14:15 GMT
Organization: Stefan Ram
Lines: 24
Expires: 1 Sep 2027 11:59:58 GMT
Message-ID: <break-20261011111215@ram.dialup.fu-berlin.de>
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> <11aeeau$24vgh$1@dont-email.me> <11aefu7$254m6$1@dont-email.me> <FlByS.11178$mPXe.3035@fx06.ams4>
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-Trace: news.uni-berlin.de 35J/pMLSQvZesw6EDCIUcQCxlgHlGEsABTf1h0em+yr5IG
Cancel-Lock: sha1:FHKl/MQ6ReRVuNxaig5JLUKLFLE= sha256:ObfRFyXMHsj4i+zUA8CmkB/122dAd6GCH+0gvY8kXkM=
X-Copyright: (C) Copyright 2026 Stefan Ram. All rights reserved.
Distribution through any means other than regular usenet
channels is forbidden. It is forbidden to publish this
article in the Web, to change URIs of this article into links,
and to transfer the body without this notice, but quotations
of parts in other Usenet posts are allowed.
X-No-Archive: Yes
Archive: no
X-No-Archive-Readme: "X-No-Archive" is set, because this prevents some
services to mirror the article in the web. But the article may
be kept on a Usenet archive server with only NNTP access.
X-No-Html: yes
Content-Language: en