有结构体
struct cmd_pattern
{
unsigned int sign_start_high;
unsigned int sign_start_low;
unsigned int sign_end_high;
unsigned int sign_end_low;
unsigned int cmd_contant[2][7];
};
//结构体变量初始化
struct cmd_pattern cmd_ram= //cmd_ram初始化
{
9024,4512,540,24414,540,540,540,540,
{
{68,2,0x83,0x55,0x90,0x6F,0},
{68,2,0x83,0x55,0x90,0x6F,0}
}
};
. . .
. . .
若一函数要用到结构体当中的cmd_contant数组
定义此函数时,如下书写其形参
unsigned char IR_Encode(unsigned int (*p)[7])
{
....;
....;
}
调用时实参如下书写:
IR_Encode ( & ( cmd_ram . cmd_contant+1 ) ) ;//把二维数组的1行的一维数组首地址传到形参。
但为什么会报错呢,找不到原因,请教。
|