"IsLowercase()" minus the "\0" and "space" checks

I was wishing the “\0” and “space” checks could be done with additional conditions in the first “if”.

For instance:

if (Word.length() < 1 || Word.compare(’ ‘) == true || Word.compare(’\0’) == true )

This would have made sense in my mind but it gives me an error saying I can’t convert argument 1 from “char” to “const char*const”. At that point I thought maybe I should use a typecast on either the Word or " " and “\0” but I was starting to feel like I was straying from the object of the exercise.

Edit: Looking at the rest of the video I guess I was over-thinking the issue. If I had tested the code, I would have seen that spaces and \0 fail the “Islower()” check anyway.

Privacy & Terms