【发布时间】:2010-09-29 21:23:23
【问题描述】:
我是 C# 编程的新手,并试图调用 C++ 中的包装函数。
在 C++ 中我有以下原型的函数
string* swap(string* ptr1, string*ptr2){
//swap the array of string
return ptr2;
}
如何将此函数包装到 C# 中(最好使用 SWIG,但不是必需的)?
【问题讨论】:
-
该数组是如何终止的?不能传数组的大小吗?
-
什么是字符串类型?它是 std::string 还是其他一些结构/类或字符数组?能写的具体一点吗?
标签: c# c++ marshalling swig