1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Problem with String Matching

Discussion in 'C' started by rsk8332, Feb 23, 2008.

  1. rsk8332

    rsk8332 New Member

    Feb 23, 2008
    Likes Received:
    Trophy Points:

    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


Share This Page