In learning C, I've just begun studying pointers to structures and have some questions.
Suppose I were to create a structure named myStructure
, and then create a pointer myStructurePointer
, pointing to myStructure
. Is *myStructurePointer
, and myStructure
two ways of referencing the same thing? If so, why is it necessary to have the -> operator? It seems simpler to use *myStructurePointer.variable_name
than myStructurePointer->variable_name
.