home *** CD-ROM | disk | FTP | other *** search
/ The C Users' Group Library 1994 August / wc-cdrom-cusersgrouplibrary-1994-08.iso / listings / v_10_10 / 1010066a < prev    next >
Text File  |  1992-08-11  |  680b  |  33 lines

  1. struct s_date
  2.     {
  3.     int month;
  4.     int day;
  5.     int year;
  6.     };
  7.  
  8. int function_requiring_pointer_to_date(struct s_date * p_date);   
  9. int function_requiring_reference_to_date(struct s_date & date);   
  10.  
  11. void calling_function()
  12.     {
  13.     struct s_date my_date;
  14.     function_requiring_pointer_to_date(&my_date);   
  15.     function_requiring_reference_to_date(my_date);   
  16.     ...
  17.     };
  18.  
  19. int function_requiring_pointer_to_date(struct s_date *p_date)
  20.     {
  21.     int month;
  22.     month = p_date->month;
  23.     ....
  24.     }       
  25.  
  26. int function_requiring_reference_to_date(struct s_date & date)
  27.     {
  28.     int month;
  29.     month = date.month;
  30.     ...
  31.     }       
  32.  
  33.