Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

check string in c

Name: Anonymous 2009-05-24 9:14

what the fast way to check that string contain only characters within some set like "a-z0-9"?

Name: Anonymous 2009-05-25 11:06

>>34
Superior iterative version.

int is_inset(const char *s)
{
    while (*s)
    {
        if (!(*s>='a' && *s<='z' || *s>='0' && *s<='9'))
            return 0;
        ++s;
    }
    return 1;
}

Name: Anonymous 2009-05-25 12:01

>>35
How is it superior if it uses fucking failure(TM) indentation style?

Name: Anonymous 2009-05-25 12:31

>>36
This is C, not Haskell. We don't support purely fictional indentation styles here.

Name: Anonymous 2009-05-25 12:33

>>36
fucking failure? You don't know what you're talking about. Indentation in >>34 is PIG DISGUSTING!!

Name: Anonymous 2009-05-25 12:33

>>36
Faggot. I bet you enjoy single closing braces with no sign of its opening brother in the vertical line, faggot.

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List