By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
454,925 Members | 1,129 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 454,925 IT Pros & Developers. It's quick & easy.

Store Queue in a flat memory space ?

P: n/a
Hi,
I have another question for the group.
I would like to know if there is a quick way by which I could store a
Queue in a flat memory space without the use of iterators ?

Thanks
-Dhanvi

Jul 23 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
On Sat, 23 Jul 2005 09:47:56 +0400, Dhanvi <ka**********@gmail.com> wrote:
Hi,
I have another question for the group.
I would like to know if there is a quick way by which I could store a
Queue in a flat memory space
Yes, you can. You can store queue in array or list. The list may be also
be stored in array.
without the use of iterators ?


Iterators do not impose any restrictions on the data structure they
provide access to, rather contrariwise.

--
Maxim Yegorushkin
<fi****************@gmail.com>
Jul 23 '05 #2

P: n/a
Dhanvi wrote:
Hi,
I have another question for the group.
I would like to know if there is a quick way by which I could store a
Queue in a flat memory space without the use of iterators ?

Thanks
-Dhanvi


Example :

#include <queue>
#include <vector>

std::queue< int, std::vector<int> > q
By default, deque is used as the underlying sequence for a queue.
However, the standard (as far as I can tell) does not guarantee
contiguous storage for deques (is this what you mean by flat memory space?).

-Alan
Jul 23 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.