-1

私はこれで助けが必要です私は構造体を持っています

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]);

これは正しい方法ですか、そうでなければ私に知らせてください。

4

2 に答える 2

0

これが役立つと思います:

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);
}
于 2014-09-16T09:49:16.397 に答える