#include <iostream.h>
#include <string.h>

/*  Example showing the difference in use between the formats:
      employee.name
      employee->name
    But why can employee.name be used inside the subroutine strcpy?
*/

struct employee {
  char name[64];
  long id;
  float salary;
};

void set_id(employee *person)
{
  cout << "Write employee id: ";
  cin >> person->id;
}

void main(void)
{
  employee my_employee;

  #Setting a field in the struct:
  strcpy(my_employee.name,"Ole Hansen");

  #Setting a field in the struct inside a function or subroutine
  set_id(&my_employee);
}

