C++ uninitialized local variable

前端 未结 5 676
夕颜
夕颜 2020-11-27 23:41

I have a function:

VOID GetOSVersion(PDWORD major, PDWORD minor, PDWORD build)
{
    OSVERSIONINFO osver;
    ZeroMemory(&osver, sizeof(OSVERSIONINFO));
         


        
5条回答
  •  温柔的废话
    2020-11-28 00:27

    Those are pointers. They are not pointing at any memory you have allocated. They do not get "filled" in the function, they get used to access (uninitialized) memory.

提交回复
热议问题