title: Queue of Strings in C
body: <p>I am trying to edit this program. Right now the users enters symbols and I want to make it work with Strings. </p>
  
  <pre><code>#include &lt;stdio.h&gt;
  #include &lt;stdlib.h&gt;
  
  struct Node
  {
      char data;
      struct Node *next;
  };
  
  struct queue
  {
      struct Node *top;
      struct Node *bottom;
  }*q;
  
  void Write(char x)
  {
      struct Node *ptr=malloc(sizeof(struct Node));
      ptr-&gt;data=x;
      ptr-&gt;next=NULL;
      if (q-&gt;top==NULL &amp;&amp; q-&gt;bottom==NULL)
      {
          q-&gt;top=q-&gt;bottom=ptr;
      }
      else
      {
          q-&gt;top-&gt;next=ptr;
          q-&gt;top=ptr;
      }
  }
  
  char Read ()
  {
      if(q-&gt;bottom==NULL)     
      {
          printf("Empty QUEUE!");
          return 0;
      }
      struct Node *ptr=malloc(sizeof(struct Node));
      ptr=q-&gt;bottom;
      if(q-&gt;top==q-&gt;bottom)
      {
          q-&gt;top=NULL;
      }
      q-&gt;bottom=q-&gt;bottom-&gt;next;
      char x=ptr-&gt;data;
      free(ptr);
      return x;
  }
  
  int main()
  {
      q= malloc(sizeof(struct queue));
      q-&gt;top=q-&gt;bottom=NULL;
      char ch='a';
      printf("NOTE: To stop the entry, please enter 'q'!\n\n Enter a String: \n");
      while(ch!='q')
      {
          scanf("%c",&amp;ch);
          Write(ch);
      }
      printf("\nThe entered String:\n\n");
      while(q-&gt;bottom!=NULL)
      {
          ch=Read();
          printf("%c",ch);
      }
      printf("\n\n");
      system("PAUSE"); 
      return 0;
  }
  </code></pre>
  
  <p>So I am editing it like this (the code below) and I get error "[Error] incompatible types when assigning to type 'char[10]' from type 'char *'" </p>
  
  <pre><code>#include &lt;stdio.h&gt;
  #include &lt;stdlib.h&gt;
  
  struct Node
  {
      char data[10];
      struct Node *next;
  };
  
  struct queue
  {
      struct Node *top;
      struct Node *bottom;
  }*q;
  
  void Write(char x[10])
  {
      struct Node *ptr=malloc(sizeof(struct Node));
      ptr-&gt;data=x;
      ptr-&gt;next=NULL;
      if (q-&gt;top==NULL &amp;&amp; q-&gt;bottom==NULL)
      {
          q-&gt;top=q-&gt;bottom=ptr;
      }
      else
      {
          q-&gt;top-&gt;next=ptr;
          q-&gt;top=ptr;
      }
  }
  
  char Read ()
  {
      if(q-&gt;bottom==NULL)     
      {
          printf("Empty QUEUE!");
          return 0;
      }
  
      struct Node *ptr=malloc(sizeof(struct Node));
      ptr=q-&gt;bottom;
      if(q-&gt;top==q-&gt;bottom)
      {
          q-&gt;top=NULL;
      }
      q-&gt;bottom=q-&gt;bottom-&gt;next;
      char x=ptr-&gt;data;
      free(ptr);
      return x;
  }
  
  int main()
  {
      q= malloc(sizeof(struct queue));
      q-&gt;top=q-&gt;bottom=NULL;
      char ch][10]='a';
      printf("NOTE: To stop the entry, please enter 'q'!\n\n Enter a String: \n");
      while(ch!='q')
      {
          scanf("%c",&amp;ch);
          Write(ch);
      }
      printf("\nThe entered String:\n\n");
      while(q-&gt;bottom!=NULL)
      {
          ch=Read();
          printf("%c",ch);
      }
      printf("\n\n");
      system("PAUSE"); 
      return 0;
  }
  </code></pre>
  
  <p>I can't solve this problem, so I would love to get some help...</p>