common parts in two strings

Can anyone indicate where I can find C++ code, that gives all (not only longest common substring) common parts from two strings.

for example: from input strings str_1="AAAACGTTAAAAPLKAAAAAHJKLOAAAA";
str_2="XXXXXCGTTXXXPLKXXXXXHJKLOXXXXX";

I expect to get list

CGTT
PLK
HJKLO


Thanks.
1. How do you compute the "longest common substring"?

2. What should f( "CGTTPLK", "PLKCGTT" ) return?

3. What should f( "PLK", "PLKXPLK" ) return?
Topic archived. No new replies allowed.