It's checking two separate conditions. Look at the test:
if (isalpha(c) || (c == '\'' && index > 0))
The first checks to see if the character is an alpha. If it is, then process it. The second test,
(c == '\'' && index > 0) checks to see if the character is an apostrophe AND that the apostrophe is not the first character (i.e., index > 0).
Also, you need to look at the parentheses that dictate what is processed together. This is essentially
if ( a || (b) ) where
a is the isalpha() test and
(b) is actually two conditions that must both be met - it must be an apostrophe AND it must not be the first character. More precisely, it would be
if( A || ( B && C ) meaining that either A is true, or BOTH B & C are true. If A is true, B and C are ignored because the whole statement is automatically true. If A is false, then both B and C are checked. If A is false and B is then found to be false, then the whole statement is false and C is not checked. If A is false and B is true, then C is finally checked. Only then, if A is false, and B and C are both true, the whole statement is true.
As a practical matter, if the first char is an alpha, the statement is true, then the loop comes back around and index is incremented and is greater than 0.
If this answers your question, please click on the check to accept. Let's keep up on forum housekeeping. ;-)