Go4Expert

Go4Expert (http://www.go4expert.com/)
-   C (http://www.go4expert.com/forums/c/)
-   -   Problem with String Matching (http://www.go4expert.com/forums/string-matching-t9000/)

rsk8332 23Feb2008 07:35

Problem with String Matching
 
Hi,

Suppose I have one character array as A,B,B,B,A,A,B and another character array as A,B,A,A,A. Now using find () I can find the second string matches the first where the pattern starts at B,A,A. Suppose I dont know the pattern. Using find() I can only find the match location but how do I find the length of the pattern? It may be mentioned that I take the two strings as input from the key board and for the given example, the output should be:

A B B B A A B
A - - B A A A


Any help much appreciated

Thanks


All times are GMT +5.5. The time now is 00:16.