[英]string* [] in c++ converts to string[] in c#
I am a beginner in dot net. 我是dot net的初学者。 My Doubt is the following:- In a dll a function takes
string* []
as one of its parameters. 我的疑问如下: - 在一个DLL中,一个函数将
string* []
作为其参数之一。 Now this method needs to be used in c#. 现在这个方法需要在c#中使用。 This dll reference is added to c# project.
这个dll引用被添加到c#项目中。 Now in c# project when pressing f12 ie "Go to definition" for this function, it displays
string[]
in place of string* []
and long in place of long long in function prototype, eg :- Suppose in dll the function looks like- 现在在c#项目中按下f12,即“转到定义”这个函数,它在函数原型中显示
string[]
代替string* []
并代替long long,例如: - 假设在dll中函数看起来像 -
public void fn(long long a, string* attributeNames[]) {....}
Now in C#- 现在在C#中 -
After adding dll reference to current c# project. 添加dll引用到当前的c#项目之后。 F12 is pressed on function name, then in Meta Data it displays following function prototype-
在功能名称上按下F12,然后在Meta Data中显示以下功能原型 -
public void fn(long a, string[] attributeNames);
This dll is wrapper that contains both managed as well as unmanaged code. 这个dll是包含托管代码和非托管代码的包装器。
Thanks in Advance. 提前致谢。
The C++ is converted to IL which is translated to C# in the metadata. C ++转换为IL,在元数据中转换为C#。
You don't need to explicitly define pointers in C#, reference types are implicitly pointers. 您不需要在C#中显式定义指针,引用类型是隐式指针。 That is why
string* attributeNames[]
converts to string[] attributeNames
这就是
string* attributeNames[]
转换为string[] attributeNames
long long
in C++ is a 64 bit integer which in C# is the long
C ++中的
long long
是64位整数,在C#中是long
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.