方法一、伪代码
//.h
#define OUTPORT_NUM 4
typedef struct imgrect
{
unsigned int srcx;
unsigned int srcy;
unsigned int srcw;
unsigned int srch;
}imgrect_t;
int OUTSLOT_NUM = 6;
imgrect_t(*cutrect)[OUTPORT_NUM];
//.cpp
//new创建
cutrect = new imgrect_t[OUTSLOT_NUM][OUTPORT_NUM];
//二维数组赋值
for(row=0;row<4;row++)
{
for(col=0;col<4;col++)
{
cutrect[row][col].srcx=480;
}
}
方法二
imgrect_t **cutrect = new imgrect_t *[OUTSLOT_NUM];
for(int i = 0; i <OUTPORT_NUM;i++){
cutrect[i] = new imgrect_t[OUTPORT_NUM];
}