Article View: comp.lang.c
Article #288Re: Taming The Switch-Statement
From: Scott Lurndal
Date: Mon, 12 Oct 2026 19:52
Date: Mon, 12 Oct 2026 19:52
22 lines
1770 bytes
1770 bytes
bart <bc@freeuk.com> writes:
>On 12/10/2026 18:58, Dan Cross wrote:
>> In article <11ainqf$3kkvd$1@dont-email.me>, bart <bc@freeuk.com> wrote:
>
>This is my first example expressed in C (note those first three args are
>passed by reference):
>
> while (pmtype = nextcmdparam(¶mno, &name, &value, "m") {
> switch (pmtype)
> case pm_option: ...; break;
> case pm_sourcefile:
> if (passlevel == run_pass || passlevel == runpcl_pass) {
> break;
Aside from the incorrect syntax, it's really difficult to
determine your intent from this code fragment.
It's likely that folks here could provide more idiomatic
C if you described the problem you're attempting to solve
rather than providing an incomplete and incorrect code
fragment.
Technical Details
Message-ID:
<GTazS.183760$ygUb.176068@fx23.iad>Path:
mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!peer02.iad!feed-me.highwinds-media.com!news.highwinds-media.com!fx23.iad.POSTED!not-for-mailReferences:
<119qf6l$2rmg3$1@dont-email.me> <11agils$2s3tg$1@dont-email.me> <11ahpqi$38ir0$2@dont-email.me> <11ainqf$3kkvd$1@dont-email.me> <11aj73v$c2u$1@reader2.panix.com> <11ajcv8$3u33s$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!peer02.iad!feed-me.highwinds-media.com!news.highwinds-media.com!fx23.iad.POSTED!not-for-mail X-newsreader: xrn 9.03-beta-14-64bit Sender: scott@dragon.sl.home (Scott Lurndal) From: scott@slp53.sl.home (Scott Lurndal) Reply-To: slp53@pacbell.net Subject: Re: Taming The Switch-Statement Newsgroups: comp.lang.c References: <119qf6l$2rmg3$1@dont-email.me> <11agils$2s3tg$1@dont-email.me> <11ahpqi$38ir0$2@dont-email.me> <11ainqf$3kkvd$1@dont-email.me> <11aj73v$c2u$1@reader2.panix.com> <11ajcv8$3u33s$1@dont-email.me> Lines: 22 Message-ID: <GTazS.183760$ygUb.176068@fx23.iad> X-Complaints-To: abuse@usenetserver.com NNTP-Posting-Date: Mon, 12 Oct 2026 19:52:06 UTC Organization: UsenetServer - www.usenetserver.com Date: Mon, 12 Oct 2026 19:52:06 GMT X-Received-Bytes: 1536