I have a quick question about C style struct's. I was digging through some sample code and found a struct declared in the following way:
typedef struct _STRUCTNAME
{
// struct contents
} STRUCTNAME;
Please note the lack of an underscore on the second time STRUCTNAME shows up. My understanding was that this would declare a single _STRUCTNAME called STRUCTNAME and no more objects of this struct could be instantiated.
However, this does not seem to be the case. A struct of this type was never actually instantiated in the code except in one place: in a global array of such objects that was used in random places:
const struct STRUCTNAME ARRAYNAME[] =
{
// various STRUCTNAMEs declared here
};
Note the lack of an underscore again (which I thought was the name of the instantiated object?)
Is my understanding completely off?
Could someone explain?