UPGRADE YOUR BROWSER

We have detected your current browser version is not the latest one. Xilinx.com uses the latest web technologies to bring you the best online experience possible. Please upgrade to a Xilinx.com supported browser:Chrome, Firefox, Internet Explorer 11, Safari. Thank you!

取消
显示结果 
搜索替代 
您的意思是: 
Visitor yanjian
Visitor
189 次查看
注册日期: ‎11-28-2018

已知值的二维数组如何在头文件中定义

#define Rotate[3][3]      {0.84455, -0.00419, 0.53547,0.00352, 0.99999, 0.00227,-0.53547, -0.00003, 0.84455}
#define Transpose[3][1]     { -0.00306, -0.03207, 0.00206}
#define CamcameraMatrix[3][3]    {2892.45384, -0.77943, 925.03464,0, 2896.55407, 587.20266,0, 0, 1}

在头文件中定义已知值的二维数组,这样定义是否正确?

0 项奖励
2 条回复2
Xilinx Employee
Xilinx Employee
145 次查看
注册日期: ‎07-17-2008

回复: 已知值的二维数组如何在头文件中定义

#define一般是宏定义,不适用于二维数组的初始化。

-------------------------------------------------------------------------
Don't forget to reply, kudo, and accept as solution.
-------------------------------------------------------------------------
0 项奖励
Visitor yanjian
Visitor
141 次查看
注册日期: ‎11-28-2018

回复: 已知值的二维数组如何在头文件中定义

二维数组的初始化是否应该放在主函数中?

static  double Rotate[3][3]={0.84455, -0.00419, 0.53547,0.00352, 0.99999, 0.00227,-0.53547, -0.00003, 0.84455};
static  double Transpose[3][1] ={ -0.00306, -0.03207, 0.00206};
static  double CamcameraMatrix[3][3]={2892.45384, -0.77943, 925.03464,0, 2896.55407, 587.20266,0, 0, 1};

上面在主函数中这样初始化是否合适?

0 项奖励