01 int search(char whichLetter, char &favorite, int n);
Do you see what is incorrect here?
11 if(whichLetter[mid] = favorite) 12 return mid;
This won't work either because the array is not sorted.
13 else if(whichLetter[mid] > favorite)
The search function won't work because the array is not sorted alphabetically - you have stated the letters are jumbled.
You will have to use a linear search - just check each element in turn, probably with a for loop.
This post has been edited by #define: 12 May 2013 - 05:52 PM