title: Linked list structures initialized in functions not being assigned properly
body: <p>I'm sure this has been asked before, but I cannot find anything on this website or any other about it after searching for quite awhile. </p>
  
  <p>I''m having trouble getting the values of structures that I'm creating and modifying in a function. The code looks something like: </p>
  
  <pre><code>struct node {
    char name[35];
    int employeeID;
    struct node *next;
  }
  
  typedef struct node employee;
  
  void insertInOrder(employee *head, employee *curr) {
    if (head == NULL) {
      *curr-&gt;next = *head;
      *head = *curr;
    } else {
      if ((head-&gt;employeeID&lt;curr-&gt;employeeID)&amp;&amp;(curr-&gt;employeeID &lt;head-&gt;next-&gt;employeeID)) {
        *curr-&gt;next = *head-&gt;next;
        *head-&gt;next = *curr;
      } else {
        insertInOrder(head-&gt;next, curr);
      }
    }
  }
  
  void addEmployee(char name[], employee *head, employee *curr) {
    int id;
    scanf("%d", &amp;id);
    curr = malloc(sizeof(employee));
    strcpy(curr-&gt;name, name);
    curr-&gt;employeeID = id;
    insertInOrder(head, curr);
  }
  
  int main(void) {
    char name[35];
    int quit = 1;
    employee *head, *curr;
    head = NULL;
    printf("Enter data about the books: \n");
    while (quit) {
      scanf("%[^\n]%*c", title);
      if (title[0] != '#') {
          addBook(name, head, curr);
      } else {
          quit = 0;
      }
  }
  </code></pre>
  
  <p>During my debugging, my code iterates into all of my functions, but once I get back to main after adding all of the data I want, all of the variables are empty. I know it has something to do with the way I'm using or passing pointers, but when I look at the code I keep coming to the logical conclusion that what I have should do what I want. Please, someone point out where my algorithm is flawed. </p>