Мне нужна помощь в этом, у меня есть структура
typedef struct {
unsigned char data0;
unsigned char data1;
// like this 8 bytes of data in my structure
} MyStruct;
typedef struct {
Mystruct my_st[8];
} Info1;
typedef struct {
unsigned char My_Array[8][7];
} Info2;
//now i want to pass the array of 8 structures in Info1 and 2D array of Info2 .
My_Function( &Info1->my_st[8], &Info2->My_Array[8][7]);
это правильный путь, иначе, пожалуйста, дайте мне знать.
Прототип должен быть
void My_Function(MyStruct (&my_st)[8], unsigned char (&My_Array)[8][7]);
и назовите это так:
Info1 info1;
Info2 info2;
My_Function(info1.my_st, info2.My_Array);
Но было бы проще иметь:
void My_Function(Info1 &info1, Info2 &info2);
а также
Info1 info1;
Info2 info2;
My_Function(info1, info2);
Я думаю, что это поможет вам:
typedef struct {
unsigned char data0;
unsigned char data1;
// like this 8 bytes of data in my structure
} MyStruct;
typedef struct {
MyStruct my_st[8];
} Info1;
typedef struct {
unsigned char My_Array[8][7];
} Info2;
//declare My_Function
void My_Function(MyStruct[], unsigned char[][7]);int main()
{
Info1 i;
Info2 j;
// use My_Function
My_Function(i.my_st,j.My_Array);
}