All pastes #2054060 Raw Edit

Stuff

public c v1 · immutable
#2054060 ·published 2011-05-05 03:48 UTC
rendered paste body
char *find_char(char const *source, char const *chars){    char *cp;    char *csp;    for ( cp = &source[0]; cp != NULL; )    {        for ( csp = &chars[0]; csp != NULL; )        {            if( *cp == *csp++ )                return cp;            printf("%c - %c \t", *cp, *csp);        }        cp++;    }    return NULL;        }int main(void){    char *source = "ABCDEF";    char *chars  = "123456";    char *result = find_char(source, chars);    if (result == NULL)        printf("nothing found\n");    else printf("FOUND: %c", *result);}