title: scanf_s throws exception
body: <p>Why does the following code throw an exception when getting to the second <code>scanf_s</code> after entering an number to put into the struct.</p>
  
  <p>This by no means represents a complete linked list implementation.</p>
  
  <p>Not sure how to get onto the next <code>scanf_s</code> when having entered the value? Any ideas?</p>
  
  <p>EDIT: Updated code with suggested solution, but still get an <code>AccessViolationException</code> after first <code>scanf_s</code></p>
  
  <p>Code:</p>
  
  <pre><code>struct node
  {
      char name[20];
      int age;
      float height;
      node *nxt;
  };
  
  int FillInLinkedList(node* temp)
  {
  
  int result;
  temp = new node;
  
  printf("Please enter name of the person");
  result = scanf_s("%s", temp-&gt;name);
  
  printf("Please enter persons age");
  result = scanf_s("%d", &amp;temp-&gt;age); // Exception here...
  
  printf("Please enter persons height");
  result = scanf_s("%f", &amp;temp-&gt;height);
  
  temp-&gt;nxt = NULL;
  if (result &gt;0)
      return  1;
   else return 0;
  }
  
  // calling code
  
  int main(array&lt;System::String ^&gt; ^args)
  {
    node temp;
  
    FillInLinkedList(&amp;temp);
  
  ...
  </code></pre>