title: enqueue() method adds one element to the queue: how to implement in C++?
body: <p>I'm having a hard time trying to implement this method since array subscripts in C++ start with zero. The method add one element to the queue. You can use f (front) and r (rear) pointers and a sequential list of size n. If you find that additional variables are needed fell free. Thanks.</p>
  
  <p>Thats my try but I know its wrong:</p>
  
  <pre><code>void QueueAr::enqueue(const Object&amp; x){
      prov = (r % n) + 1;
      if(prov != f){
          r = prov;
          queueArray[r] = x;
          if(f = -1){
              f = 0
          }
      }else{
          //queue is full
      }
  }
  </code></pre>
  
  <p>How do I work with the pointers? If I start them pointing to NULL I cant use pointer arithmetic.</p>