Else if statement executing unexpectedly, behaving as else statement : <p>I'm working on a simple function to convert ascii codes to array indexes, and I'm have a bit of trouble with the else-if statement. </p>

<pre><code>int getIndex(char character) {
    int code = int(character);
    int index = -1;

    if (code == int(' ')){
         index = 26;
    }  else if (int('a') &lt;= code &lt;= int('z')) {  
        index = code - int('a');
    }     
    return index;
}
</code></pre>

<p>The if condition works fine and fires on spaces, but the else if statement fires in every other case, regardless of whether the character is in the range a to z or not. Is there a problem I can't see with the condition? </p>
