queues with counter

Can some one provide me an example code having a queue with a counter. The idea is If i add a element in the queue, the counter should increase and if i delete an element from the queue it should decrement the counter,
how about using a vector?

you can get the number of elements saved in it via size()

Edit: there is a queue in the std lib, also featuring a size function: http://www.cplusplus.com/reference/queue/queue/
Last edited on
http://www.cplusplus.com/forum/general/68320/ is this code implemented the same?
Last edited on
pls reply me that alone!!
Topic archived. No new replies allowed.