title: Random Queue in C
body: <p>I've written this code with all correct understandings i have. please check my problems.</p>
  
  <pre><code>#include&lt;stdio.h&gt;
  #include&lt;stdlib.h&gt;
  </code></pre>
  
  <p>// Define a structure for the dequeue elements</p>
  
  <p>This structure is all good, with data, next, previous pointers.</p>
  
  <pre><code>typedef struct RanElmt_ {
  
      void *data;
      struct DeqElmt_ *prev;
      struct DeqElmt_ *next;
  
      void (*destroy)(void *data);
  
  
  
  //Your Code here
  } RanElmt;
  </code></pre>
  
  <p>THis is ok too, acording to what i think is correct.</p>
  
  <pre><code>typedef struct RandQ_{
      int size;
      struct RanElmt *head;
      struct RanElmt *tail; 
  
  
  
  }RandQ;
  
  
  
  RandQ * RandomizedQueue(void (*destroy)(void *data)){
  
      RandQ *relmt = (RandQ*)malloc(sizeof(RandQ));
  
  
  
  }     // construct an empty randomized queue
  
  
  int isREmpty(RandQ *rQ){
      if ( rQ-&gt;size == 0)
          return 1;
      return 0;
  }                                  // is the queue empty?
  
  int rsize(RandQ *rQ){
  
      return rQ-&gt;size;
  
  }    
                               // return the number of items on the queue
  </code></pre>
  
  <p>ACtually this is only one function,(enqueue) I'm going to get the idea and code other functions(dequeue, sample etc..)</p>
  
  <pre><code>int enqueue(RandQ *rQ, const void *data){
      RanElmt *relmt = (RanElmt*)malloc(sizeof(RanElmt));
      relmt-&gt;data = (void*)data;
      if (rQ-&gt;head == NULL){
          relmt = rQ-&gt;head;
          relmt = rQ-&gt;tail;
          relmt-&gt;prev = NULL;
          relmt-&gt;next = NULL;
      }
      else{
          rQ-&gt;head = relmt;
      }
  
      (rQ-&gt;head)-&gt;prev = relmt;
      relmt-&gt;prev = rQ-&gt;head;
      rQ-&gt;head = relmt;
  
  }                // add the item
  
  
  
  
  main(){
  
      Deque(free);
  
  
      printf(" okk \n");
  }
  </code></pre>
  
  <p>THis program is giving these errors:</p>
  
  <p><a href="http://i.stack.imgur.com/WbcLb.png" rel="nofollow">Errors i'm getting</a> </p>