Driver code
int main ( ) { string needle = " MAGIC " ; string input [ ] = { " BBABBM " , " CBMBBA " , " IBABBG " , " GOZBBI " , " ABBBBC " , " MCIGAM " } ; string str [ ARRAY_SIZE ( input ) ] ; int i ; for ( i = 0 ; i < ARRAY_SIZE ( input ) ; ++ i ) { str [ i ] = input [ i ] ; } cout << " count : ▁ " << searchString ( needle , 0 , 0 , str , ARRAY_SIZE ( str ) , str [ 0 ] . size ( ) ) << endl ; return 0 ; }