1,306 Topics
![]() | |
I trying to read in from a file but getting runtime errors can some one help find the .txt file as an attachment [CODE]#include<iostream> #include<set> #include<stack> #include<queue> #include<algorithm> #include<fstream> using namespace std; int main() { const int size= 7; char input[size]; fstream nameFile; nameFile.open("words.txt"); if(!nameFile) { cout<<"error cannot open file"<<endl; … | |
Hello, good morning guys! I got a problem here with my submenus of Stack and Queue link list. When I try to add an item, it won't display and pop the items when I try to select the display and pop functions. Same as well with Queue. Can anyone help … | |
What would the workflow/logic be for distributing resources to players? I currently have a Java server as a component to the game, would you suggest i just distribute X number of resources to players every second? (X is defined in the database) Or are there any mathematical formulas which can … | |
HI, I have an excersise for school but don't know if I solve it correctly so maybe is here a good place for my questions. It's a Breadth-first search algorithm. here is a picture. [URL="http://www.shrani.si/f/2b/SK/2SKKVUSy/drawing1.jpg"]http://www.shrani.si/f/2b/SK/2SKKVUSy/drawing1.jpg[/URL] now I have to resolve these (start with node 2) : This is my table … | |
i made a vector class "MyVector" inherited from a base class "arrayList" which is derived from a base class linearlist. whenever i compile i get a fatal error: [COLOR="Red"]LINK : fatal error LNK1561: entry point must be defined[/COLOR] [CODE]// abstract class linearList // abstract data type specification for linear list … | |
Hi all, I'm developing a library. I would like that this library could make differents callbacks to the user part. Untill now, I had the simplest way to do it, I had stored a pointer to the user class and I was making calls when something happened, but with this … | |
I keep getting this error and I can't figure out what is wrong. error C2227: left of '->capacity' must point to class/struct/union/generic type 1> type is 'int *' Here is the class header and declaration that I am working on. [CODE]#ifndef MYVECTOR_H #define MYVECTOR_H #include <iostream> //#include <sstream> //#include <string> … | |
Hi, I've been developing some code that parses output reports and re-reports on information that is of interest. I utilize strtok quite heavily in this program and I have run into the situation where my final strtok call may or may not return some info. Depending on if there is … | |
Hello, I am trying to create a script that will compare two identical pieces of hardwares configuration files (that are added via a GUI provided as part of the device) and to synchronize the two devices configurations. I currently have a shell script that connects to and downloads the configuration … | |
Anyone have a clue. This is pretty straight foward and it's mostly copied from another program I use right now and that program works perfectly... I just don't know what the heck is up. Any help would be appreciated!!!! I have made test files to work with as well as … | |
hi please help me....can you give me a code for queue program??? the flow look like this: KEY FUNCTION E Enqueue D Dequeue H Hide implementation S Show implementation R Bubble sort *note 10 numbers to be inputed. | |
Hi everyone. I wonder why the following code doesn't draw anything. [code=java] package AssProgLang; import java.awt.*; import javax.swing.*; import java.util.*; public class AssOutput extends JPanel { public AssOutput(Queue translatedQueue) { this.translatedQueue = translatedQueue; outputFrame = new JFrame(); outputFrame.getContentPane().add(this); // outputPanel attributes outputFrame.setLocationRelativeTo(null); outputFrame.setPreferredSize(new Dimension(640, 480)); //this.setPreferredSize(new Dimension(640, 480)); outputFrame.pack(); outputFrame.setTitle("ASSâ„¢ … | |
I kind of understand the basic concept of adding to the end / overwriting the oldest when the buffer is full, but i am not sure about where to add new data in the buffer when there is free space at the start of the array (the left hand side) … | |
In order to traverse a tree you could use something like this: [B]For inorder traversal:[/B] [CODE=C++] inorder(TreeNode* currentNode) { if (currentNode) { inorder(currentNode->LeftChild); cout << currentNode->data; inorder(currentNode->RightChild); } } [/CODE] [B]For preorder traversal:[/B] [CODE=C++] preorder(TreeNode* currentNode) { if (currentNode) { cout << currentNode->data; preorder(currentNode->LeftChild); preorder(currentNode->RightChild); } } [/CODE] [B]For post … | |
Hi, I currenty working on some assignment. This requires a server to process some entities for specific time. after that time server not process any entities further. I don't get to how to start implemet this. Plz help Thanks in advance. | |
I have some callback method that set on my queue some bitmap. This callback is called every 3 millisecond. What i mean is that my queue will be fill up with a new bitmap every 3 Millisecond. I trying to get the first picture ( this is queue ... ) … | |
Hi, I have this following code for watershed algo to segment an image. But I do not know what the error is. Can someone help me out [CODE]namespace watershed1 { public partial class Form1 : Form { public int X; public int Y; public int Height; // labels the pixel … | |
Hello, Is there any way of checking all elements in a queue without calling pop(). [code] while(!q.empty()){ cout << q.front() << endl; q.pop() } [/code] this is essentially what I have done. There is a bug in my program and I'm trying to check what is wrong. I don't want … | |
With std::queue I've been using this: [code] std::queue<int>::iterator pos = std::find( q.begin(), q.end(), 5); [/code] But when I try that with std::stack : [code] std::stack<int>::iterator pos = std::find( s.begin(), s.end(), 5); [/code] I get [code] error: ‘iterator’ is not a member of ‘std::stack<int, std::deque<int, std::allocator<int> > >’ [/code] Anyone know … | |
Hi I have a fundamental question, about new projects using wizard • For File/New wizard Win32 projects the applications include the message queue and message loop. • For File/New wizard MFC Application Dialog Based there is no message loop and message Queue How can I add message loop and message … | |
I have read all the MSDN docs on this subject that seemed relevant, but I am still confused about a few things. I am trying to achieve functionality like WSAAsyncSelect(), but use a separate thread instead of the main window. Can I use the regular WSAEventSelect() for this? and if … | |
hello everyone! I wanted to create a priority queue in which there would be different dictionaries with their priority numbers. The major problem I'm experiencing is that the queue just prints the dictionaries without regard for their priority. Please what do I have to do so that the queue prints … | |
hi i'm new and i've got this problem i can't figure out when overloading the assignment operator for a queue object. here's what i've got so far: [CODE]nodeType<Type> *current, *newNode, *last; //pointers for adding nodes bool doneOnce=false; if(this!=&otherQueue){ //no self copying destroyQueue(); if(otherQueue.queueFront==NULL) //if queue is empty, save some time … | |
Hi everyone, I just started doing C++ coming from a java background. I'm writing a discrete event simulator at the moment and need to put 'job' objects into a priority queue and sort them by their next job time- i.e. shortest job time first. I first tried doing the following: … | |
Hello, I am trying to write a simple program which listens to some data on network and writes to a file. I decided to use mmapped files because the data is very large (magnitude of 3-5 Gigs) and very fast. so as expected, i put the data in queue and … | |
Hi All I'm using SetWindowsHookEx to hook the keyboard. The connection is made and I am able to trap key presses. I'm also trying to call GetKeyboardState to obtain the state of the other keys at the time of the key press (to identify if shift, ctrl etc is pressed). … | |
I have been studying c++ on my own for about a year (i'm 11) and have mastered classes, functions, logical operations, and some other basic things. Now I'm interested in learning to make and use GUIs. I already know how to make a message box and have the code but … | |
![]() | Hi, Yesterday I downloaded and extracted ActiveMQ and ran the consumer/producer example and it worked. Today I did the exact same thing but I get the following feedback: [CODE] C:\Java\apache-activemq-5.3.2\example>ant consumer Buildfile: C:\Java\apache-activemq-5.3.2\example\build.xml init: compile: [javac] C:\Java\apache-activemq-5.3.2\example\build.xml:146: warning: 'includeantruntime' was not set, defaulting to build.sysclasspath=last; set to false for repeatable … ![]() |
Hi everyone, I have a "This should be simple!" kind of problem. I need to do a little socket programming on a SunOS machine. I went back to an old school assignment I did years ago, cut-n-pasted that code, intending to basically cannibalize it for the program I need to … | |
Dear All, Could you tell me how to complete this coding? so it can run like the program that I have attached. Cheers, [CODE] type node = ^data; data = record nama : string; ipk : real; {tipe data info} yudisium:string; next : node; end; linkedlist = record first : … | |
Hello, im making a fact system, and I need a refresh script, For example when someone clicks on the "next fact" button, the "div" part (where the fact is displayed) refreshes. ONLY the div part. and the javascript below is externally loaded... [CODE]/ ============================================== // Copyright 2004 by CodeLifter.com // … | |
i went to college to be an engineer, came out 6 years later with a degree in discrete mathematics, & have since worked as a software developer in a corporate IT shop. i'm considering retooling once again, this time towards something like what i suppose people mean by industrial engineering. … | |
Hello and thanks for any assistance, I wrote this basic script to batch make test forms for a side project. In its current state it works fine and I can pass file names to it no problem. It will take the form embeded in the code and create 10 additional … | |
The API says that the implementation of BlockingQueue are thread safe, but about the drainTo method, it says : [QUOTE]"This operation may be more efficient than repeatedly polling this queue. A failure encountered while attempting to add elements to collection c may result in elements being in neither, either or … | |
Hi. I am trying to write server side windows forms application that supports multiple clients. What I want is following: 1) I need an infinite while loop to accept new connections. In order to do that I start new thread which executes while loop. I can't execute while loop without … | |
I'm learning as i go on a side project i'm trying to do, but am having trouble finding the information i need. I'm making a website with individual user pages with lists specific to them; think netflix or gamefly. I have repeating regions of information for one object, and i … | |
I am trying to implement the A* algorithm in C++ ([url]http://en.wikipedia.org/wiki/A*_search_algorithm[/url]). The pseudocode i am trying to implement is: [code]function A*(start,goal) closedset := the empty set // The set of nodes already evaluated. openset := set containing the initial node // The set of tentative nodes to be evaluated. g_score[start] … | |
Hi, I'm having trouble with my program,here is one of the error code: Error 1 error LNK2019: unresolved external symbol "public: __thiscall linkedListType<int>::linkedListType<int>(void)" (??0?$linkedListType@H@@QAE@XZ) referenced in function "public: __thiscall linkedQueueType<int>::linkedQueueType<int>(void)" (??0?$linkedQueueType@H@@QAE@XZ) main.obj Mesina_Wk5Assignment The following are the codes to my program [CODE] // linkedList.h file #ifndef H_LinkedList #define H_LinkedList #include … | |
This problem originates from a job interview which could be solved in C++ or C#. As far as I can remember it was to implement a queue that can be added to by multiple threads and accessed by multiple threads. I haven't tried it in C# yet although I think … | |
I am trying to implement a toArray() method in my PriorityQueue. The PriorityQueue returns an array of Objects, but I want to do is have an array of the original type of objects which in this case is Job (which is marked by the 'T1'. The following is the toArray() … | |
Define a class Queue_time that represents a queue of Time objects (from our textbook) by keeping its elements in a dynamically allocated array (with maximum capacity) and make the queue as a "circular array" (the first element follows the last one). Supply the "big three" memory management functions. Use this … | |
[COLOR="Red"][I]Hey everyone, I've finally gotten my program to build with no errors or warnings and I can run it but it doesn't give all of the correct output. The Instructor provided my class with what the correct output should be and my program gets it partly right just not all … | |
Hello, I can't seem to get my program to build correctly. It seems I've finally gotten close because now it will build with no errors but with 2 warnings. I'm not sure what else to change in my code to fix it. Could anyone please help? Here's my code: [CODE]// … | |
I have two questions one is kind of a newbie question and the other one is a little more advanced. I have been coding C++ off and on for the past couple of years as a hobby and a little for my EE classes. I usually in my class reference … | |
I'm running Eclipse for Java. I created a DOM version of an XML file. Now I want to change an attribute of an element in the file. I called a method that called a method in the class that controls the DOM, and I got a dialog box saying "JDI … | |
I am tring to remove three string from a que using nodes. When I try to remove the third one it does so, but then I get a debugging error. I think the problem is that I am not deleting the last node but I cannot figure out what I … | |
que.print is not working and I cannot figure out why not I posted a lot of code because I cannot figure out where the error is, I think it is in que.cpp, but I am nto sure what is wrong. Here is the main [CODE]#include "Stack.h" #include "Que.h" #include<string> #include … | |
Can someone please double check to make sure I have these right. Here are the instructions... Assume that q is a queue implemented as described using circular array with queueElement = char and capacity 5, and then ch is of type char. Show the values of myFront and myBack and … | |
c program to implement a stack using two queue | |
The queue class needs to inherit protectedly from the list class My code won't compile because of this line towards the bottom listPtr = &myqueue; if i comment out this line, it compiles and runs, but without this line i can't do what i want. I need this line to … |
The End.