title: How to acces pointer in a structure
body: <p>This is my code :</p>
  
  <pre><code>#include &lt;stdio.h&gt;
  #include &lt;string.h&gt;
  #include &lt;stdlib.h&gt;
  
  typedef struct pers
  {
      int age;
      char *name;
      float height;
  }Person;
  
  void read(Person p[], int *nr) // an array of persons, and nr is the number of persons
  {
      scanf("%d", nr);
      int i;
      for(i = 0; i &lt; *nr; i++)
      {
          scanf("%d", &amp;p[i].age);
          p[i].name = calloc(100, sizeof(char));
          scanf("%s", p[i].name);
          scanf("%f", &amp;p[i].height);  
      }
  }
  
  int main()
  {
      int nr;
      Person p[100];
      int i;
      read(p, &amp;nr);
      for(i = 0; i &lt; nr; i++)
      {   
          printf("%d\n", p[i].age);
          printf("%s\n", p[i].name);
          printf("%f\n", p[i].height);
      }
  return 0;
  }
  </code></pre>
  
  <p>I don't know why this not stocate well the data . How can i do with pointers or anything else, to have acces to age and height and also to the *name</p>
  
  <p>If i try only with age and height the code works, but when i add the name, it stucks.</p>
  
  <p>this is my input</p>
  
  <pre><code>3 // numbers of persons
  23 // age
  John Smith //firstname + lastname         //1person
  182.5 //height
  18
  Mat Plow                                  //2person
  152.6
  56
  Alex Grim                                 //3person
  172
  </code></pre>
  
  <p>Any ideas? </p>
  
  <p>i think i might use gets and with some pointer, but i don't know how :D</p>
  
  <p>Thank you !</p>