473,729 Members | 2,197 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

implementation of queue in c++

how can i implemete a pointer-based queue in c++?

Jul 23 '05 #1
5 5561
surrealtrauma wrote:
how can i implemete a pointer-based queue in c++?


Why would you want to: what about using std::queue?
Best

Kai-Uwe Bux
Jul 23 '05 #2
Kai-Uwe Bux wrote:
surrealtrauma wrote:
how can i implemete a pointer-based queue in c++?


Why would you want to: what about using std::queue?


Because std::queue is value-based (like any Standard container), not
pointer-based?

Jul 23 '05 #3
Rapscallion wrote:
Kai-Uwe Bux wrote:
surrealtrauma wrote:
> how can i implemete a pointer-based queue in c++?


Why would you want to: what about using std::queue?


Because std::queue is value-based (like any Standard container), not
pointer-based?


I am confused, very likely, I do not understand what "pointer-based queue"
means: what about std::queue< T* > or some std::queue< SmartPtr< T > > ?
Best

Kai-Uwe Bux
Jul 23 '05 #4

"Rapscallio n" <ra********@spa mbob.com> wrote in message
news:11******** **************@ g47g2000cwa.goo glegroups.com.. .
Kai-Uwe Bux wrote:
surrealtrauma wrote:
how can i implemete a pointer-based queue in c++?


Why would you want to: what about using std::queue?


Because std::queue is value-based (like any Standard container), not
pointer-based?


A standard container can both provide the allocation mechanism or let the
user manage it. What makes you believe that a valid derefenced pointer is
not a value?
Jul 23 '05 #5
Rapscallion wrote:
Because std::queue is value-based (like any Standard container), not
pointer-based?

I am not sure what you mean. It is implemented by using pointers and can store variables,
pointers or any other objects.

--
Ioannis Vranos

http://www23.brinkster.com/noicys
Jul 23 '05 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
1332
by: Andreas Mallek | last post by:
hello, i'm looking for a good method to create an short path algorithm like dijkstra. well.. i hope that i can find someone that already integrated spa's with python. my goal is to find ways from contact-person A to contact-person B. but i have to save and sort all the possible ways in a depth of about nine
6
2916
by: MPowell | last post by:
Lets suppose the return value on new_command is MSG2_STATUS My intent then is to memcpy the data via the call to CMDHolder and have a function that'll retrieve a copy of the 'stored' data. The latter I'm unsure how to do. Any help appreaciated. #include <iostream> #include <map>
6
1047
by: Nikolay Petrov | last post by:
I need to write tcp client/server program. The client should connect to server at specified intervals and download some data. The data is collection of strings. What I don't know how to do is how to implement some kind of queue, so this string as queued at server, then client connects, get them, clear them from queue and process them. The client should interpret these string as separate objects, not as an whole. Forget the string part....
4
4598
by: j_depp_99 | last post by:
Thanks to those guys who helped me out yesterday. I have one more problem; my print function for the queue program doesnt work and goes into an endless loop. Also I am unable to calculate the length of my queue. I started getting compilation errors when I included a length function. <code> template<class ItemType> void Queue<ItemType>::MakeEmpty() {
1
3038
by: VanKha | last post by:
I write a queue program but it doesn't work properly:I enqueue an element and dequeue just after that, but the output is the first value and then many times of "Empty queue.."!Why ?Please help me. #include<iostream> #include<conio.h> using namespace std; class Node{ private: int value; Node * next; public:
11
5243
by: amolbehl | last post by:
Hi. Does anyone know how to implement queue in VB6.0 ? I just need the push function to push end of queue and pop to remove an item from top of the queue.
0
2075
by: clintp | last post by:
I've seen a few people asking for this elsewhere, so here's a basic implementation of a string trie in C#. I'm using this to load and search a dictionary of about two hundred thousand words. It's fairly quick (a couple of seconds for the full load). It's a bit of a memory hog -- about 50MB resident, once the file is loaded -- but most of my C#/.NET programs are. Example usage: StringTrie st = new StringTrie();
0
2200
by: tabassumpatil | last post by:
Please send the c code for: 1.STACK OPERATIONS : Transfer the names stored in stack s1 to stack s2 and print the contents of stack s2. 2.QUEUE OPERATIONS : Write a program to implement DOUBLE ENDED QUEUE operations a) Use names as data to perform all operations like enqueue,dequeue,print,etc. b)Use students records as data to perform the same operations. 3.FILE OPERATIONS: write c program to implement following FILE operations:...
14
16967
by: AlarV | last post by:
Hello everyone, here is my problem. I have to make a dynamic priority queue,which is a heap, and my book isn't helpful at all, so I have no clues on how to create it.. I read something like a static priority queue, which is an array heap, and for example i/2 is the father of i and so on.. the code of the static priority queue is this: int i= ++CurrentSize; while(i != 1 && X > heap) { // cannot put x in heap heap = heap; //move...
0
8923
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9285
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
8155
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6722
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6025
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4529
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
3238
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
2686
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2165
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.