title: How to change the member value of a struct object? (C++ struct beginner)
body: <p>Just beginning to learn about structs, I thought I understood how they work, using the dot operator to access a member of an object, but i clearly don't as the <strong>readEmployeeRecord</strong> function below doesn't work at all. How should i be doing this? (the code is short and self explantory)</p>
  
  <p>Many thanks for taking the time to further explain structs to me! Naturally I tried google first but i couldn't find an example that inputted data quite the way i wanted and wasn't sure how i should be going about it.</p>
  
  <pre><code>#include &lt;iostream&gt;
  #include &lt;iomanip&gt;
  
  using namespace std;
  
  //Employee type
  struct Employee{
      float wage;
      char status;
      char dept[4]; //for 3letter department, last position is \0 correct?
  };
  
  //function definitions
  void readEmpoyeeRecord(Employee staff);
  void printEmployeeRecord(Employee staff);
  
  int main(){
  
      Employee employeeA;
      readEmpoyeeRecord(employeeA);
      printEmployeeRecord(employeeA);
      return 0;
  }
  void readEmpoyeeRecord(Employee employee){
      cout &lt;&lt; "Enter empolyees wage: ";
      cin &gt;&gt; employee.wage;
      cout &lt;&lt; "Enter empolyees status (H or S): ";
      cin &gt;&gt; employee.status;
      cout &lt;&lt; "Enter empolyees dept (ABC): ";
      cin &gt;&gt; employee.dept;
  }
  void printEmployeeRecord(Employee staff){
      cout &lt;&lt; "Wage:     Status:     Department:" &lt;&lt;endl;
      cout &lt;&lt; fixed &lt;&lt; setprecision( 2 ) &lt;&lt; staff.wage;
  }
  </code></pre>