本文介绍了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#的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!