C ++ struct二维数组到C# [英] C++ struct two dimension array into C#

查看:271
本文介绍了C ++ struct二维数组到C#的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述


可能重复:

什么是管理/非托管类型组合无效。意味着?

我们将如何在C#中编写这些结构(用C ++编写)

how we will code these structures(Written in C++) in C#

typedef struct tagBIRDMATRIX
{
short   n[3][3];    // array of matrix elements
}BIRDMATRIX;


推荐答案

大小应该是你十字架中的元素数量产品。

The size should be the number of elements in your cross product.

 struct BIRDMATRIX
 {
    [MarshalAs(UnmanagedType.ByValArray, SizeConst = 9)]
    short[,] n;
 }

这篇关于C ++ struct二维数组到C#的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆