Finding a letter in a string array.

I am trying to find a the fourth letter when 5 names are put into an array. From using a for loop forexample when John is imputed into a ray. It will say ‘n’ or if there is no forth letter It will say “no fourth letter”. I have been running into issues so any help would be greatly appreciated.

Thanks
Last edited on
first get a pointer to the beggining of a name, meaning run a while loop that discard the whitespace using isalpha() -> http://www.cplusplus.com/reference/cctype/?kw=cctype
then check the 3 next characters, if all are letters, then you got your fourth letter of the name :)
Last edited on
Topic archived. No new replies allowed.