Comparing two words and printing mutual characters?

Hello.

So I have two char arrays: ABDBA and ABCED. How can I write a code, that would compare those two arrays and print the how much mutual characters (in the same spots) they have?

For example, ABDBA and ABCED have 2 mutual characters in the same spots - A and B, so the printed number would have to be 2.

Any ideas?
A loop.
for each pair
  if current pair is a match
    increment count
Topic archived. No new replies allowed.