title: question on struct with char array
body: <p>Below is my code snippet</p>
  
  <pre><code>struct encode
  {
  
     char code[MAX];
  
  }a[10];
  
  int main()
  { 
  char x[]={'3','0','2','5','9','3','1'};
  
    for(i=0;i&lt;1;i++)
    {
  
        printf("%c",x[i]);
  
  //This will printout like 3025931 now I want this to be stored in structure.         
    }
  
  strcpy(a[0].code,x); 
  // or 
  a[0].code=x;//neither works
  
  display();
  
  }
  
  void display()
  {
  printf("%c",a[0].code);
  }
  </code></pre>
  
  <p>I want the output to be like:3025931. </p>
  
  <p>Which I am not getting due to incompatible assign type. Please tell me where am i going wrong.</p>