PushFront method for an array C++
<p>I thought i'd post a little of my homework assignment. Im so lost in it. I just have to be really efficient. Without using any stls, boosts and the like. By this post, I was hoping that someone could help me figure it out.</p>

<pre><code>bool stack::pushFront(const int nPushFront)
{     
     if ( count == maxSize ) // indicates a full array
     {
        return false;
     }
     else if ( count &lt;= 0 )
     {
      count++;
      items[top+1].n = nPushFront;
      return true;
     }
     ++count;
     for ( int i = 0; i &lt; count - 1; i++ )
     {
      intBackPtr = intFrontPtr;
      intBackPtr++;
     *intBackPtr = *intFrontPtr;
     }
     items[top+1].n = nPushFront;
     return true;    
}
</code></pre>

<p>I just cannot figure out for the life of me to do this correctly! I hope im doing this right, what with the pointers and all</p>

<pre><code>int *intFrontPtr = &amp;items[0].n;
int *intBackPtr  = &amp;items[capacity-1].n;
</code></pre>

<p>Im trying to think of this pushFront method like shifting an array to the right by 'n' units...I can only seem to do that in an array that is full. Can someone out their please help me?</p>
