No one has voted on any posts yet. Votes from other community members are used to determine a member's reputation amongst their peers.
13 Posted Topics
Hi. I'm getting the following message when I try to overload operator= here in line 830-833. I have also included the error messages. Thanks #include <iostream> #include <string> #include <limits> #include <vector> #include <iomanip> #include <cstdlib> using namespace std; /** * Global Variables */ string k; int pmem, plen; int … | |
Hi. Can someone tell me how to output a two-dimensional priority queue please? In particular I am using an array of priority queues. The method I use to output an array of vectors is not working. I will show the one that is working (array of vectors): if(!diskQueues[i].empty()) { for … | |
Hi. I want to output all of the processes in the printer queue here, and I'm not able to figure out quite how to do that. The only process that shows up is the last one I entered. For instance, if I put a process into printer queue 1 and … | |
If I prompt the user for n number of printers, is there a way of creating n number of vectors on the fly as opposed to creating vectors and putting them in your class structure at the start? I have to create as many printer queues as a user specifys. … | |
Hi. I'm having a problem accessing a function of an object which I put into a vector. When I try to read the vector at lines 503-506 , I get an output of whatever number I set my setTau() function, instead of the correct number. The beginning value for the … | |
I'm trying to understand this function. I try to compile an run it, but it gives an error message at line 12. Thanks. #include <iostream> #include <string> #include <cmath> using namespace std; int stringConvertInt(string raw) { int sum=0, power=0; power=raw.length()-1; for(int i=0; i<raw.length(); i++) { sum=sum+(pow(10,power)*(raw[i]-48)); power--; } return sum; … | |
I'm having a problem accessing information between classes. The following simple program illustrates the problem. I have two classes. Int Cell and second. IntCell has a single data member: storedValue. I initialize the value of storedValue to 0, and then assign a value of 16 to it in main() on … | |
Hi. Why am I getting different output when I call the calculate() function? The output on line 184 gives 1.0001, while the output from line 433 gives 1. Thanks. #include <iostream> #include <string> #include <limits> #include <vector> #include <iomanip> using namespace std; /** * Global Variables */ string k; int … | |
Hi. I'm trying to implement a disk scheduling algorithm using a vector. I am able to find the smallest element of the vector with my findMin() function: int computer::findMin( vector<int> v ) { int minIndex = 0; for( int i = 1; i < v.size( ); i++ ) if( v[ … | |
I'm having trouble displying the contents of a queue. When I pop the queue here: for( int i = 0; i < diskQueue.size() + 1; i++ ) { cout << left << setw(0) << "--d" << i+1 << left << setw(4) << " " << left << setw(14) << diskQueue.front().getFilename() … | |
Hi. Can someone explain why this isn't working? #include <iostream> #include <list> #include <string> #include <iomanip> using namespace std; /** * Global Variables */ int printer; int disk; int cd; int num; int pmem, plen; int dmem, dlen; int cmem, clen; class PCB { public: PCB() : pid( 0 ), … | |
Hi. I'm trying to access some data in a List using an Iterator, but I'm getting an error message: #include <iostream> #include <list> #include <string> #include <iomanip> using namespace std; /** * Global Variables */ int printer; int disk; int cd; int num; string k; int pmem, plen; int dmem, … | |
Hi. Can someone tell me why the following code is giving me an error message? Thank you. #include <iostream> #include <list> #include <string> #include <iomanip> using namespace std; /** * Global Variables */ int printer; int disk; int cd; int num; string k; int pmem, plen; int dmem, dlen; int … |
The End.