2023-04-25

Address of a structure variable (in C)

When I declare a structure below

struct {
 int a;
 int b;
} x;

&x is the address of the structure, right? But as far as I'm concerned, a structure is a collection of data, so I don't really understand what specific address &x points to. When you have an array, let's say,

char a[] = "This is a test";

*a points to the first element of the array a[], which is a[0]. What about the case above?



No comments:

Post a Comment