title: Assigning a pointer to a struct to a variable
body: <p>I'm having trouble using the pointer returned by the make_employee function out in the main program.</p>
  
  <p>//    I have the following code in a separate .c file:</p>
  
  <pre><code>struct Employee;
  
  struct Employee* make_employee(char* name, int birth_year, int start_year){
    struct Employee* new = (struct Employee*)malloc(sizeof(struct Employee));
    strcpy(new-&gt;name, name);
    new-&gt;birth_year = birth_year;
    new-&gt;start_year = start_year;
    return new;
  }
  
  
  //In the main program:
  
  int main()
  {
    char test_name[] = "Fred";
    int test_birth = 1989;
    int test_start = 2007;
  
    Employee Fred;
  
    make_employee(test_name, test_birth, test_start) = &amp;Fred;     &lt;-- throws invalid lvalue error
  
    return 0
  }
  </code></pre>