Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 257
  • Last Modified:

queue

Can you please show me a simple example of a integer function that returns the number of items in a queue.
0
jnejdecce
Asked:
jnejdecce
1 Solution
 
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
 
AssafLavieCommented:
oh, duh!
it should be typed:
std::queue<int> qi; // for example
0
Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

 
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

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now