Liste des Groupes | Revenir à cu shell |
Rainer Weikusat <rweikusat@talktalk.net> wrote:cross@spitfire.i.gajendra.net (Dan Cross) writes:>
>
[...]
>In any event, this seems simpler than what you posted:>
>
#include <stddef.h>
#include <stdio.h>
#include <stdlib.h>
>
int
main(int argc, char *argv[])
{
if (argc != 2) {
fprintf(stderr, "Usage: matchd <str>\n");
return EXIT_FAILURE;
}
>
for (const char *p = argv[1]; *p != '\0'; p++)
if ('0' <= *p && *p <= '9')
return EXIT_SUCCESS;
>
return EXIT_FAILURE;
}
It's not only 4 lines longer but in just about every individual aspect
syntactically more complicated and more messy and functionally more
clumsy.
That's a lot of opinion, and not particularly well-founded
opinion at that, given that your code was incorrect to begin
with.
Les messages affichés proviennent d'usenet.