If I create a structure in C++ like this:
typedef struct node {
int item;
int occurrency;
};
I know that a structure is allocated in memory using successive spaces, but what is the name of the structure (node in this example)? A simple way to give a name to the structure?
nodeis the name of the type. You can have multiple objects of that type:In this example, both
aandbhave the same type (==node), which means that they have the same layout in memory. There’s both ana.itemand ab.item.