I am currently trying to compare two words. Example : String1 = "BAAA", String2 = "AA".
What i would like to do is to find how many occurrence of String2 present in String1. In my example, the occurrence of "AA" in "BAAA" will be twice. Locations are 2nd and 3d.
Is there any functions which can do such comparison and provide all the found locations of occurrence? I have found memchr(), but if i understand correctly, it will only give the first occurrence.