Hello there,
It will always return no match, because the two pointers do not equal each other.
Think about it for a quick moment.... what is an array? An array is a pointer to a data structure with elements inside it.
For example:
stringa = pickle
stringa[1] == p
stringa[2] == i
stringa[3] == c
and so on
What you are trying to tell the computer is to "compare all of the elements from string a and see if they are the same in string b". The == operator is going to balk at this, as it is seeing your array name, and not the elements within.
You have two ways to do this...
METHOD 1:
* Write a FOR LOOP
---> count the amount of elements in string a
* Write another FOR LOOP
---> count the amount of elements in string b
* Do a quick compare....
---> if elements(a) <> elements(b) you know that they are not the same.
---> note that if someone puts a space after the last character before hitting return, it will garble up your code doing this. Remember, computers are precise! And they will make precisely the wrong decision that you expect.
* Write another FOR loop (remember that both strings are the same length)
--> compare stringa(n) == stringb(n) and break loop if they diverge
METHOD 2
Check out the strcmp function library. I think it returns a 1 if they are different, and 0 if they are not. MUCH EASIER!!
Christian