title: Read and show the name and age using pointers as function parameters
body: <p>I want to write a function to read the name and the age of someone and a function to show them after using pointers as parameters.</p>
  
  <pre><code>#include &lt;stdio.h&gt;
  #include &lt;stdlib.h&gt;
  #include &lt;string.h&gt;
  
  void read(char **name, int *age)
  {
    printf("name: ");
    scanf("%s", *name);
    printf("age: ");
    scanf("%d", age);
  }
  
  void write(char *name, int age)
  {
    printf("%s, %d\n", name, age);
  }
  
  int main(void)
  {
    char *name;
    int age;
    read(&amp;name, &amp;age);
    write(name, age);
    free(name);
    return 0;
  }
  </code></pre>
  
  <p>When I run this I get error message : <code>Process terminated with status -1073741819 (0 minute(s), 2 second(s))</code>. Is it because I did not allocate any memory for <code>name</code>? Can you please explain me what am I doing wrong?</p>