Listing 6 Using the member-of operator to reference members in structs makes this code faster than passing the structure by value.

struct s_date
   {
   int month;
   int day;
   int year;
   };

int function_requiring_pointer_to_date(struct s_date * p_date);
int function_requiring_reference_to_date(struct s_date & date);

void calling_function()
   {
   struct s_date my_date;
   function_requiring_pointer_to_date(&my_date);
   function_requiring_reference_to_date(my_date);
   ...
   };

int function_requiring_pointer_to_date(struct s_date *p_date)
   {
   int month;
   month = p_date->month;
   ....
   }

int function_requiring_reference_to_date(struct s_date & date)
   {
   int month;
   month = date.month;
   ...
   }