什么是C#无效**? [英] What is void** in C#?
问题描述
我期待通过C#程序,它使用C语言编写的一个图书馆,我碰到这条线,并不能肯定这是什么来源:
I'm looking through the source of a C# program that uses a library written in C. I came across this line and was unsure what it was:
cvbimUNSAFE.GetImageVPA ((cvbim.IMG)cvImg.Image, 0, (void**)&lpImageBits, &pVPAT);
是什么类型的对象无效**
?我做了一些谷歌搜索,只能找到关于无效*
,这是一个指向某种渔获所有顶级类型的信息,如果我理解正确的。
What is an object of type void **
? I did some Google searches and could only find information about void*
, which is a pointer to a sort of catch all top level type, if I understood correctly.
推荐答案
这是一个指针的指针的东西没有规定。基本上,只要把它看作一个内存指针到原始内存指针。
It's a pointer to a pointer to something not specified. Basically, just think of it as a memory pointer to a raw memory pointer.
因此, INT **
是一个指向一个指向 INT
,但无效**
是一个指针的指针,但它没有指定什么指针指向。
So, int**
is a pointer to a pointer to an int
, but void**
is a pointer to a pointer, but it's not specified what that pointer is pointing at.
我做了一些谷歌搜索,只能找到有关的void *,这是一个指向某种渔获所有顶级类型的信息,如果我理解正确的。
I did some google searches and could only find information about void*, which is a pointer to a sort of catch all top level type, if I understood correctly.
不太。 无效*
是一个指针的东西,只是没有规定它是什么东西,应该只是被看作是一个指向内存的原料大块,你需要用些结构。例如,的malloc
返回无效*
,因为它返回一个指向内存的原料大块。
Not quite. void*
is a pointer to something, it's just not specified what that something is and should just be thought of as a pointer to a raw hunk of memory that you have to apply some structure to. For example, malloc
returns a void*
because it's returning a pointer to a raw hunk of memory.
这篇关于什么是C#无效**?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!