Liste des Groupes | Revenir à cu shell |
cross@spitfire.i.gajendra.net (Dan Cross) writes: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.
That's not at all an opinion but an observation. My opinion on this is
that this is either a poor man's attempt at winning an obfuscation
context or - simpler - exemplary bad code.
Les messages affichés proviennent d'usenet.