Consider for example this declaration
struct {
char *OwO[12];
}iwi;
It at first declares an unnamed structure with one data member that has the type of an array with 12 elements of the type char *
. And then it declares an object named iwi
of the structure.
So to access the data member OwO
of the object iwi
you can use the expression
iwi.OwO
that returns lvalue of the array OwO
.
If to apply the operator *
to the expression then the array OwO
is implicitly converted to pointer to its first element and has the type char **. Dereferencing the pointer we get the first element of the array of the type char *
.
We can assign the element with a string literal as
*iwi.OwO = "What's this?";
That is the first element of the array that has the type char *
now gets the address of the string literal.
Here is a demonstrative program
#include <stdio.h>
struct {
char *OwO[12];
} iwi;
int main(void)
{
*iwi.OwO = "What's this?";
printf( "%s\n", *iwi.OwO );
return 0;
}
Its output is
What's this?
In the original code this unnamed structure is included into two other unnamed structures
struct {
struct {
struct {
char *OwO[12];
}iwi;
}uwu;
}owo;
That is with have object owo of the unnamed outer structure that has data member uwu of the enclosed unnamed data structure that in turn has data member iwi of the most inner unnamed structure.
So to access the data member OwO
we have to list all names of object
owo.uwu.iwi.OwO
So we have gotten an access to the most inner data member OwO
. And now dereferncing the expression as it was shown in the demonstrative program above we initialize the first element of the array with the string literal "What's this?"
.
And in the same way we can output it using this full expression
printf("%s\n", *owo.uwu.iwi.OwO);