Replacing String objects with C strings

You must compare strings with strcmp(). If you use ==, you just compare the pointer vaiues which are almost guaranteed not to be equal.