Deutsch   English   Français   Italiano  
<vhqed2$c71$2@reader2.panix.com>

View for Bookmarking (what is this?)
Look up another Usenet article

Path: ...!weretis.net!feeder9.news.weretis.net!panix!.POSTED.spitfire.i.gajendra.net!not-for-mail
From: cross@spitfire.i.gajendra.net (Dan Cross)
Newsgroups: comp.unix.shell,comp.unix.programmer,comp.lang.misc
Subject: Re: Command Languages Versus Programming Languages
Date: Fri, 22 Nov 2024 17:18:26 -0000 (UTC)
Organization: PANIX Public Access Internet and UNIX, NYC
Message-ID: <vhqed2$c71$2@reader2.panix.com>
References: <uu54la$3su5b$6@dont-email.me> <vhq11q$nq7$1@reader2.panix.com> <877c8vtgx6.fsf@doppelsaurus.mobileactivedefense.com> <87zflrs1ti.fsf@doppelsaurus.mobileactivedefense.com>
Injection-Date: Fri, 22 Nov 2024 17:18:26 -0000 (UTC)
Injection-Info: reader2.panix.com; posting-host="spitfire.i.gajendra.net:166.84.136.80";
	logging-data="12513"; mail-complaints-to="abuse@panix.com"
X-Newsreader: trn 4.0-test77 (Sep 1, 2010)
Originator: cross@spitfire.i.gajendra.net (Dan Cross)
Bytes: 1591
Lines: 29

In article <87zflrs1ti.fsf@doppelsaurus.mobileactivedefense.com>,
Rainer Weikusat  <rweikusat@talktalk.net> wrote:
>Rainer Weikusat <rweikusat@talktalk.net> writes:
>
>[...]
>
>
>> Something which would match [0-9]+ in its first argument (if any) would
>> be:
>>
>> #include "string.h"
>> #include "stdlib.h"
>>
>> int main(int argc, char **argv)
>> {
>>     char *p;
>>     unsigned c;
>>
>>     p = argv[1];
>>     if (!p) exit(1);
>>     while (c = *p, c && c - '0' > 10) ++p;
>
>This needs to be
>
>while (c = *p, c && c - '0' > 9) ++p

No, that's still wrong.  Try actually running it.

	- Dan C.