#include <iostream>
typedef struct _person
{
std::string name;
unsigned int age;
}Person;
int main()
{
Person *pMe = new Person;
pMe->age = 10;
pMe->name = "Larson";
std::cout << "Me " << (*pMe).age << " " << (*pMe).name.c_str() << std::endl;
return 0;
}
Consider the above code. The members of the structures can be referenced in two ways. Eg., pMe->age
or (*pMe).age
. Is this just a syntactic difference or is there any functional difference available in these two approaches?