All pastes #2054057 Raw Edit

Stuff

public c v1 · immutable
#2054057 ·published 2011-05-05 03:41 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; )        {            printf("%c - %c \t", cp, csp);            if( *cp == *csp++ )                return cp;        }        cp++;    }    return NULL;        }int main(void){    char *source = "ABCDEF";    char *chars  = "ABCD";    char *result = find_char(source, chars);    if (result == NULL)        printf("nothing found\n");    else printf("FOUND: %c", *result);}