title: Char array memory allocation
body: <p>I would like to know how the result of the <code>memcpy()</code> with respect to the memory allocation.</p>
  
  <pre><code>#include&lt;stdio.h&gt;
  #include&lt;string.h&gt;
  
  typedef struct {
    char myname[7] ; 
  } transrules;
  
  trans typedef struct {
    char ip ;
    int udp;
    transrules rules[256];
  } __attribute__ ((__packed__)) myudp;
  
  myudp __attribute__ ((__packed__)) udpdata ;
  
  char arr[400] ;
  
  int main() {            
    memset (&amp;udpdata , 0 ,sizeof(udpdata));
    udpdata.ip = 'a' ;
    udpdata.udp = 13 ;
    udpdata.rules[0].myname = "lalla\0" ;
    memcpy (&amp;arr , &amp;udpdata, sizeof(udpdata));
    printf("%c",arr[0]);
    return 0;
  }
  </code></pre>
  
  <p>With respect to the code , how do we print out the character array in the structure <code>transrules</code>? </p>
  
  <p>PS : Yes this code throws an error, sheesh <code>char</code>'s !</p>
  
  <p>As the array defined is of type <code>char</code> why does arr [1] still accept an integer value with <code>memcpy()</code> ?</p>