You can use object oriented approach, like Stewbond suggested, or you can do the comparison your self by taking the different between each 2 characters. char can be treated like integers and you can take the difference between 2 letters. That's what strcmp does actually.