What is PVOID data type?

前端 未结 6 1857
粉色の甜心
粉色の甜心 2020-12-29 08:55

Can someone explain what PVOID is and how it is used in a function like:

BOOL DoSomething(PVOID pMemPhy)
6条回答
  •  不知归路
    2020-12-29 09:23

    It's a void pointer -- a pointer to a memory address with no information about the type of the value that it is pointing to. For this reason, you must cast the pointer to a type such as (char *)pMemPhy or (int *)pMemPhy before using the pointer so that the compiler knows how much memory it's working with (1 byte for a char, 4 bytes for an int, etc.)

提交回复
热议问题