OK, so i'm working on a program that analyzes a paragraph and checks for the word 'the'.
So far I thought of making an if statement within a loop that checks if the word 'the' appears but it's pretty complicated and ugly.
To check if a character is alphanumeric, you can use isalnum, and for just alphabetic, there's isalpha, both of which are found in <cctype>: http://www.cplusplus.com/reference/cctype/
Hmm...well, you could use tolower to avoid having to check for uppercase and lowercase. (So something like if (tolower(pgraph[count]) == 't' && /* ... */))
Also keep in mind that && has a stronger precedence than ||, so if (A || B && C) is equivalent to if (A || (B && C)), not if ((A || B) && C).
I'd imagine that the word "the" wouldn't be at the end of any sentence, and there should be a space between the end of a sentence and the first word of the next sentence, so you could probably just check for a space before and after each occurrence of "the".
You should also check the first word of the paragraph, since there probably won't be a space before it, and that word could easily be "the".