How to declare a void pointer in C#

狂风中的少年 提交于 2019-11-28 01:59:05

void* identifier; as described here

But it needs to be in unsafe as:

unsafe
{
    void* identifier;
}

And unsafe code has to have been allowed for the project.

I'm assuming you mean in managed code, as your question is rather short to do anything but assume.

I think you're either looking for IntPtr or simply any object reference (which is the base type, and the basic equivalent of a null pointer - a reference to "something"). Unless you mean null pointer, in which case you're looking for IntPtr.Zero.

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!