cplusplus
.com
TUTORIALS
REFERENCE
ARTICLES
FORUM
C++
Tutorials
Reference
Articles
Forum
Forum
Beginners
Windows Programming
UNIX/Linux Programming
General C++ Programming
Lounge
Jobs
Forum
General C++ Programming
queues with counter
queues with counter
Jan 11, 2013 at 3:00pm UTC
Rahul kumar S
(69)
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,
Jan 11, 2013 at 3:02pm UTC
Darkmaster
(564)
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
Jan 11, 2013 at 3:03pm UTC
Jan 11, 2013 at 3:08pm UTC
Rahul kumar S
(69)
http://www.cplusplus.com/forum/general/68320/
is this code implemented the same?
Last edited on
Jan 11, 2013 at 3:31pm UTC
Jan 11, 2013 at 3:52pm UTC
Rahul kumar S
(69)
pls reply me that alone!!
Topic archived. No new replies allowed.