All you need to do is change while (*sPtr != "\0") to while (*sPtr != '\0'). You're trying to compare a char to a string. I agree with @chris, though, you don't need to check if it's lower case. It's just messy to do so, and it won't decrease the running time of your algorithm.