How to access nested structure using pointer and array?

typedef struct
{
    unsigned int a;
    unsigned char b[10];
    unsigned char c;
}acc1;

typedef struct
{
    unsigned char z[10];
    acc1 *x,y[10];
}acc2;

extern acc2 p[2];

I want to access struct acc1 variables from acc2 array p[2].

I’m getting segmenatation faults when I do it. Please guide on how to do this


Source: c#

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.