I have the following code in C++:
string StringTest = "Test";
bool OriginalWord = true;
for (unsigned int i = 0; i < StringTest(); i++) {
string Character = towlower(StringTest[i]);
string CharacterOriginal = StringTest[i];
if (Character != CharacterOriginal) {
//t vs. T should trigger false, but never happens?
//e vs. e should trigger true
//s vs. s should trigger true
//t vs. t should trigger true
OriginalWord = false;
}
}
Note that I use towlower
instead of tolower
.
This always results in a OriginalWord=true
situation. However, e.g. Test should give me back OriginalWord=false
. Because towlower(T)
will result in t and the CharacterOriginal = T
, which means they are not the same and thus OriginalWord=false
?
What am I doing wrong? I guess it has to do something with the towlower
function