// example A
typedefstruct _NAME_A
{
int a;
int b;
} NAME_A
// example B
typedefstruct _NAME_B
{
int a;
int b;
}
// example C
typedefstruct
{
int a;
int b;
}NAME_C
is there any difference between definition or using like?
1 2 3 4
_NAME_A var_a1;
NAME_A var a2;
NAME_B var_b;
NAME_C var_c;
In example A _NAME_A is called as tag_name and NAME_A is called as type_name. As we have used typedef, we can only create variable using tag_name so
NAME_A var_a2 will give an error
else all are correct
Note: After struct whichever name comes first that will be called as tag_name.
So NAME_c var_c is also correct