'How do I implement stack and queue from a single array in c++?

I'm only familiar with using stack and queue each for different arrays.

However,if there is an array A of size 20 that stores integers, how am I going to divide the array and implement it in the stack and queue each of size 10? (Assume declaration of two classes are used for stack and queue)

Any suggestion here will be of great help.



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source