title: Tried to use gets with structs but it doesn't work
body: <pre><code>typedef struct local {
      char ender[81];  
      int room;         
  } Local;
  
  typedef struct man {
      Local *loc;       
  } Man;    
  
  main() {
  Man *c1;
  c1 = (Man *) malloc(n*sizeof(Man));
  c1.loc = &amp;c1;
  
  for(i=0; i&lt;10; i++) {
       printf("PLACE'S NAME:\n");
               gets(c1[i]-&gt;loc-&gt;ender);
  }
  }
  </code></pre>
  
  <p>Hi everyone!</p>
  
  <p>I'm having problems on this C program, can anyone help me?</p>
  
  <p>I need to ask to the user a name from a place. For doing that I did put printf (see above) and I used gets to put that name on c1->loc>ender, but it's not working. </p>
  
  <p>Tried everything, but still now having sucess. 
  Any help?</p>
  
  <p>Thanks! </p>
  
  <p>Here's what's apearring:
  <a href="https://i.stack.imgur.com/tVqq0.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/tVqq0.png" alt="enter image description here"></a></p>