title: how to access an array inside structure using a structure pointer
body: <pre><code>struct node{
      char a[100];
      struct node* next;
  };
  typedef struct node* nodeptr;
  main()
  {
      char b[100];
      nodeptr p;  
      int n;          
      printf("enter the string\n");
      scanf("%s",b);          
      n=strlen(b);                
      p=getnode();                    
      p-&gt;a=b;                             
      p-&gt;next=null;                           
      printf("%s \n",(q-&gt;a));                     
      return 0;                                       
  }
  </code></pre>
  
  <p>How can I access the array inside the struct using a struct pointer? Is this the correct method? I am getting the following error during compilation:</p>
  
  <p><code>incompatible types when assigning to type ‘char[100]’ from type ‘char *’ "</code></p>