vendredi 27 mars 2015

Comparing LPCWSTR in if()


I feel like I am missing something very obvious here...


In my program, I read user input from an edit box using GetWindowText(),

followed by this code:



if (x == L"R" || x == L"C" || x == L"L"){ n = 1; }
else{ n = 9; }


The debugger clearly says that x is L"R", but n is getting set as 9.


debugger


Is using if() in this situation wrong and should I use something else?




Aucun commentaire:

Enregistrer un commentaire