C++与C#数据类型对应关系总结

https://blog.csdn.net/u010159842/article/details/51720458

添加:

  1.c++参数含有&,c#也需要用ref关键字。

  2.在c++中声明是char*,调用是char[];c#声明为Intptr,调用使用Marshal.AllocHGlobal(Size)为其赋值。记得释放分配的内存 Marshal.FreeHGlobal(stringPointer);

     而在c#中获取这个值,使用Marshal.Copy(Intptr source.自定义类型 destination, sss, int copy起始位置, int 要copy的数目),destination即是。

猜你喜欢

转载自www.cnblogs.com/gaara-zhang/p/9367794.html
今日推荐