Win32ProcessPendingMessages comparing uint32 with const char *

Hi, I was looking into win32_handmade.cpp to see how Casey handles keypresses. I used the code below, but for some reason this does not compile for me (using cl.exe x64 version 19.12 on windows 10).

1
2
3
4
5
6
uint32 VKCode = (uint32)Message.wParam;
...
    if(VKCode == 'W')
    {
        Win32ProcessKeyboardMessage(&KeyboardController->MoveUp, IsDown);
        ...


If I try to compile this I get the following error: error C2446: '==': no conversion from 'const char *' to 'uint32_t'. Looking at the code above, I can completely understand why the compiler complains.

Am I missing something here? How come it works on Casey's machine?

Edited by judgebread on Reason: Initial post
If you mean line 3, then that's comparing a uint32 with a char (not const char*) since it's using single quotes around the W.

That should be fine and shouldn't cause the error you're seeing. Maybe the error is from a different line, or you accidentally typed the W with double quotes?
Yup. I was using double quotes. Didn't know single and double quotes mean different things in C++. Thanks for clarifying!
Double quotes are used for strings, single for chars.

So if char* word = "a";

Then: word[0] == 'a' will be true.
word == 'a' will be false.

word is just an adress to an array here.