Solved

queue

Posted on 2002-03-07
6
253 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
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
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

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

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…
Written by John Humphreys C++ Threading and the POSIX Library This article will cover the basic information that you need to know in order to make use of the POSIX threading library available for C and C++ on UNIX and most Linux systems.   [s…
The goal of the video will be to teach the user the difference and consequence of passing data by value vs passing data by reference in C++. An example of passing data by value as well as an example of passing data by reference will be be given. Bot…
The viewer will learn how to user default arguments when defining functions. This method of defining functions will be contrasted with the non-default-argument of defining functions.

685 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