word1Pointer
and word2Pointer
to 0
. These pointers will point to the current string in the arrays word1
and word2
respectively.char1Pointer
and char2Pointer
to 0
. These pointers will point to the current characters in the strings referenced by word1Pointer
and word2Pointer
.word1Pointer
and word2Pointer
have not reached the end of their respective arrays:
a. Compare the characters at char1Pointer
and char2Pointer
.
b. If they are not equal, return false
.
c. Increment char1Pointer
and char2Pointer
.
d. If char1Pointer
has reached the end of its string, move word1Pointer
to the next string and reset char1Pointer
.
e. If char2Pointer
has reached the end of its string, move word2Pointer
to the next string and reset char2Pointer
.true
. Otherwise, if one pointer has more strings to traverse, return false
.