Liste des Groupes | Revenir à l misc |
In article <87v7wfrx26.fsf@doppelsaurus.mobileactivedefense.com>,
Rainer Weikusat <rweikusat@talktalk.net> wrote:cross@spitfire.i.gajendra.net (Dan Cross) writes:>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.
If you know something that's wrong with that, why not write it instead
of utilizing the claim for pointless (and wrong) snide remarks?
I did, at length, in my other post.
Les messages affichés proviennent d'usenet.