Code:
struct hello
{
char d;
} instance;
>Accession to the structure field: instance.d = 'A'
Correct.
Code:
struct
{
char d;
} hello;
>Accession to the structure field: ??
hello.d = 'A';
Code:
typedef struct
{
char d;
} HELLO;
HELLO hello;
>Accession to the structure field: hello.d = 'A'
Correct.
Code:
typedef struct hello
{
char d;
} HELLO;
>Accession to the structure field: ??.
First you have to create an instance.
struct hello inst1;
HELLO inst2;
inst1.d = 'A';
inst2.d = 'B';
Both will work with the same effect.
>They look almost the same!
They all have very slight differences though. The first is a struct declaration with a tag and an instance. So while it has at least one instance, more can be made with the tag. The second has no tag and an instance, that instance is the only one you can have because there's no tag for further declarations. The third uses typedef to create a type for an unnamed struct, so you can use the type in declarations even though there is no tag. The fourth has both a tag and a type, so either method of declaration can be used: with the struct keyword and the tag, or just the type.
-Prelude