Solved

queue

Posted on 2002-03-07
6
249 Views
Last Modified: 2011-09-20
Can you please show me a simple example of a integer function that returns the number of items in a queue.
0
Comment
Question by:jnejdecce
6 Comments
 
LVL 6

Expert Comment

by:Triskelion
ID: 6849518
Is your queue an array of integers (characters, objects)?
How do you detect the number of items?
Is ZERO a number?
0
 
LVL 4

Expert Comment

by:AssafLavie
ID: 6849755
std::queue q;
...
return q.size();
0
 
LVL 4

Accepted Solution

by:
AssafLavie earned 50 total points
ID: 6849756
oh, duh!
it should be typed:
std::queue<int> qi; // for example
0
How to improve team productivity

Quip adds documents, spreadsheets, and tasklists to your Slack experience
- Elevate ideas to Quip docs
- Share Quip docs in Slack
- Get notified of changes to your docs
- Available on iOS/Android/Desktop/Web
- Online/Offline

 
LVL 6

Expert Comment

by:Triskelion
ID: 6850195
I've been living in C too long.
I didn't even think of that.
Duh on ME!
0
 
LVL 11

Expert Comment

by:griessh
ID: 6955301
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
 
LVL 6

Expert Comment

by:Mindphaser
ID: 6979047
Force accepted

** Mindphaser - Community Support Moderator **
0

Featured Post

Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

Join & Write a Comment

When writing generic code, using template meta-programming techniques, it is sometimes useful to know if a type is convertible to another type. A good example of when this might be is if you are writing diagnostic instrumentation for code to generat…
In days of old, returning something by value from a function in C++ was necessarily avoided because it would, invariably, involve one or even two copies of the object being created and potentially costly calls to a copy-constructor and destructor. A…
The goal of the video will be to teach the user the concept of local variables and scope. An example of a locally defined variable will be given as well as an explanation of what scope is in C++. The local variable and concept of scope will be relat…
The viewer will be introduced to the member functions push_back and pop_back of the vector class. The video will teach the difference between the two as well as how to use each one along with its functionality.

744 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

14 Experts available now in Live!

Get 1:1 Help Now