1,306 Topics
![]() | |
Having problems with executing jobs using fork. The code is supposed to create one job and execute one job and repeat this multiple times. We are only supposed to use usleep in the jobgeneration() function. We are having trouble sleeping and executing ctrl-c in the execute job function. [CODE] #include … | |
There is a queuing example problem in a textbook. I'm not enrolled in a class and I am doing this work for my own self, otherwise I'd ask the professor. I'm pretty sure I know the answer but I want to know for 100%. I believe it should be an … | |
hey this week my assignment is like this write functions for inserting and deleting elements for an ascending priority queue .implement as un unordered list and an ordered list. as usual our teacher told us to read about priority queue from any good book.i have very vague idea about priority … | |
Hi all, So I'm working on this program to use a circular doubly linked list to implement a queue class. It went fairly well, but I'm stuck on the copy constructor, which causes runtime errors whenever I try to test it. Nonetheless, I really don't see what I am doing … | |
I am attempting to edit this Queue class to only use myBack pointer, i began having errors and now I am lost.... LQueue.cpp is as follows [CODE]/*--- LQueue.cpp ---------------------------------------------------------- This file implements LQueue member functions. -------------------------------------------------------------------------*/ #include <new> using namespace std; #include "LQueue.h" //--- Definition of Queue constructor Queue::Queue() : … | |
I have to make a copy constructor for a queue class and decided to use enqueue to put the files in, but for some reason it gives a runtime error. so I really need some help in figuring out what is wrong. Thanks in advanced [CODE] #include <cstddef> #include <string> … | |
please help It says when creating the object of ArrayCharQueue that I can't because it is abstract and am not understanding why please help [CODE]//array based charqueue // must use abstract base class char queue // must be dynamically allocated #include "charqueue.h" #include <iostream> #include <cstdlib> class ArrayCharQueue : public … | |
Hello all, So I'm working on this simple program with a Queue class template that is publicly derived from the abstract base class CharQueue. The only problem is that I keep getting hit with the error "expected class name before '{' token". The reason I don't understand this is that … | |
im trying to output my bfs in this manner, showing the connections rather than the individual nodes: input 0 1 1 0 1 0 0 0 1 0 0 1 0 0 1 0 output (0,1) (0,2) (2,3) rather than: 0 1 2 3 this is my code so far, … | |
Hello All I need to write a program in C standard to solve the produce -consumer problem but I don't want to use threads, also I don't want to use Semaphore or shared memory. The exactly I need is to write the program using (Message queue) which use functions of … | |
I'm pretty sure there's just a small bug I'm missing, but I can't seem to find it. Error: g++ -Wall Proj3.cpp -o proj3 -pthread Proj3.cpp: In function âvoid initLockVar()â: Proj3.cpp:52: error: expected primary-expression before â{â token Proj3.cpp:52: error: expected `;' before â{â token Proj3.cpp:256: error: expected `}' at end of … | |
Hello everybody, I have spend the last 6 hours on trying to access a char * type within a static struct without success. I guess I use the pointers wrong but after trying "everything" I am pretty lost right now. So hopefuly someone of you can help me. I have … | |
im trying to get my code to perform dijkstra's algorithm on my adjacny matrix, it works great for the inital row (0) but i cant get it working for any other value?! [CODE]void dijkstra (int a[size][size], int matSize, string CityID[size]) { string startCity; cout << "Enter start city : "; … | |
Please help me. I am having trouble implementing the breadth first search algorithm for the classic 8 puzzle problem. I have some code if anybody can help. Or is there any tutorials or examples that you can link to me? My problem is that it only solves about 5 different … | |
Please help. (NOVICE here...bear with me).... Installed SoundBlaster Video Card, (SB Audigy), some months ago. It has never worked. (Son's computer, recently had him bring it to me for help). Checked Audio Devices, (Device Manager) and found that Legacy Audio Drivers contain no information under "Properties." Searched further, (system devices) … | |
I have a class with a button, it runs the command automatically when the gui is constructed (which i dont want it to do) but then doesnt work again after. What am I doing wrong? Builtin commands such as endcommand work as they should. relevant excerpts (ignore the indent problem … | |
Here is my assignment: [url]https://docs.google.com/document/edit?id=1lf2t8LOqKmXK8tu8lW7ghDOd1IJw9BXBRi_PDXFtPQo&authkey=CLnyu7UE&hl=en#[/url] Here are the other classes I am using: [url]https://docs.google.com/leaf?id=0B_UHOsQPEyMBNDBhMWExNTgtMTJmNy00MTQxLWI1ZGItMDZiZjM3YTZiZjRi&authkey=CP2ujcoM&hl=en[/url] I am receiving a NullPointer on line 53: regularNumbers.enqueue(i); But, I am not sure why. Additionally, I need to display my results 12 primes per line, and a space between each. Suggestions? Thanks all for taking … | |
Hi, I implemented a priority queue using STL. And that part is working great. Now, looking back on my problem it seems as though I need to know if a certain node exists in the queue. So I am looking some advice on what the best course of action would … | |
I recently had an assignment for an advanced coding class where I was to create a Binary tree from inorder and preorder traversals. I first started out by creating my ADT for binary trees and working with that to create a new tree. The way I worked it was that … | |
I have a function that needs to read a file line by line. It will check that line for a number(a process ID for my process scheduling function). The line is delimited by |. So I read the line in, get the first ID number, and then I want to … | |
tried to run a simulation for wired-cum-wireless scenario. It is good when i use a single base station. But, when i use more than one, following error is displayed. # --- Classfier::no-slot{} default handler (tcl/lib/ns-lib.tcl) --- _o92: no target for slot 0 _o92 type: Classifier/Port content dump: classifier _o92 0 … | |
Hi! I am a beginner in C++, I hope that anyone can advice me on approaching this problem. I would like to implement a class graph that uses breath-first search in order to remove a chosen vertice as well as its corresponding edges. I want to: *add or remove edges … | |
So my Turbo C doesn't handle errors. And in school we used VC++ but I don't have it at home. So can anyone tell if the code snippets for Queue and Dequeuing a Queue and Pop and Push operations in Stack are right? [CODE]\int queue::dequeue() { try { if(front>rear) throw … | |
Hi, beginner to directX following a tutorial to set up a simple window. nothing fancy just the window. Two errors. [CODE] error C2065: 'wndHandle' : undeclared identifier error C2065: 'WndProc' : undeclared identifier [/CODE] These errors are present in [QUOTE]InitWindow.cpp[/QUOTE] Heres my code [B]WinMain[/B] [CODE] /****************************************************************** * This is the … | |
i'd like to ask if to is calculate the turn around time of a particular process is: turn around time = burst time - arrival time ?? and what about response time and waiting time? like in a preemptive scheduling where a process is preempt when a new process enters … | |
Hello, I am trying to create a shop where the user can pick an item to add to their cart and after they pick the item, I want to remove it from the list, but I can't seem to remember on how to do it. [CODE] int main( void ) … | |
can any one give a slight hint about the alogirthm to evaluate a prefix expression using queue.i tried a lot bt now atthe dead end, | |
Hello, The program finds the shortest path between the user inputted nodes. The nodes are integer. Now I need to modify my code to find the path between nodes which are string. Path between A and B instead of 1 and 2. Please help me to convert my code. [code=c++] … | |
This is the main part of a project I assume all other header and cpp file are correct cuz most of them are copy from books n the professor when I run it, "right after the input" the program sort of stopped, pop out a error message, then keep running … | |
SinglyList.h [CODE] #ifndef SINGLYLIST_H #define SINGLYLIST_H #include <iostream> #include <string> using namespace std; class Exception { private: string errMsg; public: Exception(const string& err) { errMsg = err; } }; class InvalidPositionException : public Exception { public: InvalidPositionException(const string& err) : Exception(err){} }; class EmptyException : public Exception { public: EmptyException(const … | |
hi, im working with the queue class but not allowed 2 use the collections namespace, ok thats fine. paitent is the name for objects i want to queue. heres my paitent class [CODE] public class paitent { private string name; private string NHSW; private paitent next; } public string name … | |
I have an application that, on occasion, might need to perform certain tasks on files, or other things that are "in-use" while the application in running. This is what I've tried to do, but I'm running into problems: I created an interface: [CODE] interface IShutdownCommand { void OnShutdown(); } [/CODE] … | |
I'm trying to put a 2 dimensional array in a queue... How could I do that? #include<iostream> #include<queue> using namespace std; struct state { int puzzle[2][2]; }; int main() { state p; p.puzzle[0][0]=1; p.puzzle[0][1]=2; p.puzzle[0][2]=3; p.puzzle[1][0]=8; p.puzzle[1][1]=0; p.puzzle[1][2]=4; p.puzzle[2][0]=7; p.puzzle[2][1]=6; p.puzzle[2][2]=5; queue<int> Queue; Queue[front] = p; while(!Queue.empty()) { cout<<" "<<Queue.front()<<endl; … | |
Hello everybody! This is an amazing place you have built up here and I have never ceased to be amazed by the knowledge available... I have just one question which might seem quite easy to the right person so here goes. I am working with the console in C++ so … | |
hi im new her i want your help im computer student im very week in c++ i have an assingment i dont know how i can solve it this is : design and develop a program which simulates a cellular phone call processing center. The simulator has the following requirements … | |
Okay, I’ve got a noob question. It’s been awhile since I coded so I thought I’d start off at the beginning and create a template list and tree. Back in the old days I left the nodes open, but I wanted to keep the data private this time. My first … | |
Any idea how to implement a FIFO queue of chars in C? It doesn't need to be too fancy, just a fixed size (say 256 chars) and can't use any library functions (this is for a hobby OS kernel I'm writing, and there's not a lot of functions available for … | |
I can't believe I'm asking this, but this assignment I was given is proving very difficult. I was asked to find the ECLOSE function of a given Epsilon non-deterministic finite automata. All it is is the BFS tree of a graph from a given point, provided that the vertices are … | |
[CODE] #include<stdio.h> #include<stdlib.h> #define MAX 5 char queue[MAX][30]; int front, rear, temp; void init() { front = -1; rear = -1; } void insert() { if ( rear >= MAX-1 && front == -1 ) { printf("\nQueue overflow"); return ; } temp = rear; rear = ( rear + 1 … | |
I'm writing up a program for a class I'm taking where I need to make a linked list stack & queue. Right now I'm not quite done, but I'm having problems calling the functions from the .h file. What's happening is in the while loop, I'm trying to get data … | |
My professor has given me the code and I wanna run it. I use Visual Studio2008. Code contains data structure "queue". He defines one queue as "queue<int> Q;" But my compiler gives an error and says "error C2065: 'queue' : undeclared identifier" Do we need any separate header file to … | |
this is a program that my teacher gave me in the class. but i didn't understand it....please explain it to me step by step... [code= c++] #include<iostream.h> class queue { int element; queue* next; public: queue* enqueue(queue*,int); queue* dequeue(queue*); void queue_display(queue*); }*head,*tail,object; queue* queue::enqueue(queue* head,int key) { queue* temp; temp=new … | |
Hello again guys, I got here a Stack and Queue Array program. My problem is deleting an item in Queue. Here's a quick video of my problem: [url]http://www.youtube.com/watch?v=X_G82aU_LV4[/url] Here's my code: [code=C]#include <stdio.h> #include <conio.h> int main() { int a[100],n=0,i; int cho,choi,choice; clrscr(); do { printf("\n\n\n [1] Stack\n"); printf(" [2] … | |
Ok, So the problem I am having is with the LineUps class in the getTime method. What I am trying to do in the getTime method is to get the overall time of the whole Queue list. The Queue's are really LinkLists of type Person. In Person, there are two … | |
i am writing a program on huffman's code in C++. I have wriiten the program till building the huffman tree. now I have to generate the code by traversing the huffman tree. I have no idea how to do that logically. please help with code or algorithm. Here is my … | |
Hello everyone, I'm developing a multi-client server on Linux and I've noticed a strange behavior: I'm using a regular [B]Makefile[/B] to compile and run my server, nothing fancy. But now I've tried to run my server [B]by hand[/B] using the command line and my server won't accept any incoming connections … | |
Hi, I wish to implement a priority queue and I need to create it with structures, as in I will be inserting structures into the queue and I wish to keep it sorted(ascending order) it according to one of the structure elements. How can this be done? Any pointers will … | |
Hi all, Im writing a concurrent access queue. MY problem is that my producer is too much faster than the consumer, and the queue is allways filling up. I think that I have to write some congestion control, but sith sleeps? mutex? One curious thing, if i write something like … | |
In short, I've created a program that when a user left clicks it will create a dot at that location (cursor position). After doing some debugging (reviewing coords printed) it doesn't appear to be a coord problem (not sure though), but a perspective problem (may be displaying improperly). The problem … | |
I have a tabbed activity as my main class and 3 activities that it has as tabs. I've been googleing this but no luck so far. One of my activities has a thread that runs and gets messages from the telnet thread via a queue. Without going into that to … |
The End.