title: Data structure with circular queue in c
body: <p>I've found this code that shows the operation of a circular queue.
  I am experimenting with it to learn more about how queues work. 
  In this case I would like to change the following implementation that instead of printing numbers it will print sentences. </p>
  
  <p>I've tried changing the data type but it continues to print numbers.</p>
  
  <p>Any ideas?</p>
  
  <pre><code>#include &lt;stdio.h&gt;
  #include &lt;conio.h&gt;
  
  #define MAX 10
  
  void addq ( int *, int, int *, int * ) ;
  int delq ( int *, int *, int * ) ;
  void display ( int * ) ;
  
  void main( )
  {
      int arr[MAX] ;
      int i, front, rear ;
  
      system("cls" ) ;
  
      /* initialise data member */
  
      front = rear = -1 ;
      for ( i = 0 ; i &lt; MAX ; i++ )
          arr[i] = 0 ;
  
      addq ( arr, 14, &amp;front, &amp;rear ) ;
      addq ( arr, 22, &amp;front, &amp;rear ) ;
      addq ( arr, 13, &amp;front, &amp;rear ) ;
      addq ( arr, -6, &amp;front, &amp;rear ) ;
      addq ( arr, 25, &amp;front, &amp;rear ) ;
  
      printf ( "\nElements in the circular queue: " ) ;
      display ( arr ) ;
  
      i = delq ( arr, &amp;front, &amp;rear ) ;
      printf ( "Item deleted: %d", i ) ;
  
      i = delq ( arr, &amp;front, &amp;rear ) ;
      printf ( "\nItem deleted: %d", i ) ;
  
      printf ( "\nElements in the circular queue after deletion: " ) ;
      display ( arr ) ;
  
      addq ( arr, 21, &amp;front, &amp;rear ) ;
      addq ( arr, 17, &amp;front, &amp;rear ) ;
      addq ( arr, 18, &amp;front, &amp;rear ) ;
      addq ( arr, 9, &amp;front, &amp;rear ) ;
      addq ( arr, 20, &amp;front, &amp;rear ) ;
  
      printf ( "Elements in the circular queue after addition: " ) ;
      display ( arr ) ;
  
      addq ( arr, 32, &amp;front, &amp;rear ) ;
  
      printf ( "Elements in the circular queue after addition: " ) ;
      display ( arr ) ;
  
      getch( ) ;
  }
  
  /* adds an element to the queue */
  void addq ( int *arr, int item, int *pfront, int *prear )
  {
      if ( ( *prear == MAX - 1 &amp;&amp; *pfront == 0 ) || (  *prear + 1 == *pfront ) )
      {
          printf ( "\nQueue is full." ) ;
          return ;
      }
  
      if ( *prear == MAX - 1 )
          *prear = 0 ;
      else
          ( *prear )++ ;
  
      arr[*prear] = item ;
  
      if ( *pfront == -1 )
          *pfront = 0 ;
  }
  
  /* removes an element from the queue */
  int delq ( int *arr, int *pfront, int *prear )
  {
      int data ;
  
      if ( *pfront == -1 )
      {
          printf ( "\nQueue is empty." ) ;
          return NULL ;
      }
  
      data = arr[*pfront] ;
      arr[*pfront] = 0 ;
  
      if ( *pfront == *prear )
      {
          *pfront = -1 ;
          *prear = -1 ;
      }
      else
      {
          if ( *pfront == MAX - 1 )
              *pfront = 0 ;
          else
              ( *pfront )++ ;
      }
      return data ;
  }
  
  /* displays element in a queue */
  void display ( int * arr )
  {
      int i ;
      printf ( "\n" ) ;
      for ( i = 0 ; i &lt; MAX ; i++ )
          printf ( "%d\t", arr[i] ) ;
      printf ( "\n" ) ;
  }
  </code></pre>