title: updating contents of struct
body: <p>I have a char * filed(name) in my struct in which I try to update it via p_update function it returns nothing(blank),so how can I update char * ?</p>
  
  <pre><code>#include &lt;stdio.h&gt;
  //------------------------------------------
  typedef struct{
      char *name;
      int age;
      }person;
  void p_info(person *);
  void p_update(person *);
  //------------------------------------------
  int main(void){
      person p1={"bob",22};
      p_info(&amp;p1);
      p_update(&amp;p1);
      p_info(&amp;p1);
      return 0;
      }
  //------------------------------------------
  void p_info(person *p){
      printf("Name: %s\tAge: %i\n",p-&gt;name,p-&gt;age);
      }
  void p_update(person *p){
      char name[10];
      scanf("%9s",name);
      p-&gt;name=name;
      }
  </code></pre>