queue

Can you please show me a simple example of a integer function that returns the number of items in a queue.
jnejdecceAsked:
Who is Participating?
 
AssafLavieConnect With a Mentor Commented:
oh, duh!
it should be typed:
std::queue<int> qi; // for example
0
 
TriskelionCommented:
Is your queue an array of integers (characters, objects)?
How do you detect the number of items?
Is ZERO a number?
0
 
AssafLavieCommented:
std::queue q;
...
return q.size();
0
Introducing Cloud Class® training courses

Tech changes fast. You can learn faster. That’s why we’re bringing professional training courses to Experts Exchange. With a subscription, you can access all the Cloud Class® courses to expand your education, prep for certifications, and get top-notch instructions.

 
TriskelionCommented:
I've been living in C too long.
I didn't even think of that.
Duh on ME!
0
 
griesshCommented:
Dear jnejdecce

I think you forgot this question. I will ask Community Support to close it unless you finalize it within 7 days. You can always request to keep this question open. But remember, experts can only help you if you provide feedback to their questions.
Unless there is objection or further activity,  I will suggest to accept

     "AssafLavie"

comment(s) as an answer.

If you think your question was not answered at all, you can post a request in Community support (please include this link) to refund your points. The link to the Community Support area is: http://www.experts-exchange.com/commspt/

PLEASE DO NOT ACCEPT THIS COMMENT AS AN ANSWER!
======
Werner
0
 
MindphaserCommented:
Force accepted

** Mindphaser - Community Support Moderator **
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.