All pastes #767337 Raw Edit

Something

public cpp v1 · immutable
·published 2007-11-09 17:58 UTC
rendered paste body
char *word = "hello freddy";char *search = "edd";int iLocation = -1;for( int i = 0; i < (int)strlen( word ); i++ ){    for( int j = 0; j < (int)strlen( search ); j++ )    {        if( word[i+j] != search[j] ) { break; }    }    if( j == (int)strlen( search ) ) { iLocation = i; break; }}if( iLocation != -1 ) { printf( "Found %s at %i in %s.", search, iCount, word ); }else { printf( "%s not found in %s.", search, word ); }