72 Posted Topics
Is this possible? I need to read the data from a stack (and a queue), but I need to maintain the stack (and queue) so they can be used later. I have not found any useful information online. My only thought is loading the data into a parallel stack before … | |
Hello Everyone, I am working on a package delivery simulation. I believe I have a bug. Lines 47-53 give the user the option to choose a particular moment of time where they can see a snapshot of the system's status. The program seems to break down if I choose to … | |
Hello All, I am trying to return three integers from the load function below. Right now, the program only returns the throughput variable. How do I use this function so it returns all three? (I am trying to implement this in a larger project where I cannot call the load … | |
Hello Everyone, I am getting the following error on line 12. "variable or field 'start' declared void" I have deleted quite a bit of code, in case your wondering what the program is supposed to do. I don't understand why the compiler would have a problem with this function being … | |
Hello, I am getting an error when I try to pass a linked list and an iterator to the printList function below. For some reason it does not recognize the printList function call. I get the following error on line 39. no matching function for call to 'printList(std::_List_iterator<Event, std::allocator<Event> >&' … | |
Hello Everyone, I am trying to implement an overloaded < operator. I found the code below at [url]http://www.java2s.com/Tutorial/Cpp/0200__Operator-Overloading/Theoverloadedlessthanoperatorswithdoublevalue.htm[/url] I am trying to use this as a tutorial, but I don't understand what is happening on line 23-24. I am also a little fuzzy on line 9. Why can't it be … | |
Hello, It seems like every time I start a new project with classes I have trouble with this. I am getting an error "undefined reference to 'Item::Item()' I'm sure I am overlooking a simple mistake. I have been looking at this for an hour and I cannot seem to find … | |
Hello, I have been given an h file. Below is a section of the h file, with the entire h file below it. I am trying to figure out how to invoke the section directly under this message. [CODE]template <class T> ostream& operator << (ostream& os, const List<T>& s) // … | |
Hello, I am having trouble implementing the load function below. It compiles, but I get garbage in the array and 0's in the vector. The reason I created load() was to clean up main(). Do I need to open data.txt in main and then call a function to load the … | |
Hello, I am trying to implement a linked list with an h file that was provided to me, which I cannot change. I have created a simple main() to begin, but I am getting an error on line 40 of the h file that says... "template-id 'operator<< <int>' for 'std::ostream& … | |
Hello, This is my first time using vectors. The code below creates a vector of size 30, but when I run the program (which loads 30 integers into the vector), the last integer in my data.txt file does not load into the vector. When I use a vector of size … | |
I'm having trouble finding information on the implementation of "or". I want to use it in the do while loop below. [CODE] do { cout << "Please enter 1 for random or 0 for pseudorandom." << endl; //bool, 1 is TRUE, 0 False cin >> random; } while (random !0||!1);[/CODE] | |
Hello, I have a Dell Latitude D830. It is three years old. When I plug in the AC adapter (only on campus, which is very weird) I get the blue screen of death with the following error message: DRIVER_IRQL_NOT_LESS_OR_EQUAL It's very odd that it only happens when I am on … | |
Hello, I am trying to figure out how to get the rand() function to include 0. [CODE]int value = rand() % range + 1;[/CODE] No matter what I set range to be, the lower bound is always 1. | |
Hello, I am trying to get the return value from the next_number function up to the makefile function. I am getting an error that says next_number does not have a class type. EDIT: the error is "return statement with a value, in function returning 'void'" I don't understand why it … | |
Hello, I have been working on an assignment using codeblocks with the GNU GCC compiler. The assignment must compile using Visual Studio 2008. I have not been able to get my hands on Visual Studio 2008 as of yet, but I was wondering if anyone thinks I should be concerned. … | |
Hello Everyone, I am working on a program that will write random numbers to a file. I am getting the following error on line 31 of the filer.cpp file. "error: no match for 'operator<<' in 'outstream << srand((( srand(((unsigned int)time(Ou)))'" I believe the code used to generate the random number … | |
Hi, I am getting a null pointer exception with the code below. From what I have read, it seems like something is null, but I do not understand how this could be a problem? The error is occurring on line 205 of the StudentContainer class. (This is at the very … | |
I am using a keylistener and I need to know when the backspace and delete keys are used. Does anyone know how this is done? I have not found anything online. | |
I'm trying to create a program in Java that I have in C++. In my C++ file, I have main the main method outside of any classes. Eclipse does not seem to like this. Is this not possible in Java? Do I need to put main in a class? import … | |
I can't figure out why I am getting this error. I have tried #include several things and I have tried changing the location of srand. #include <iostream.h> #include <ctime> class Horse { int position; public: Horse(); //Horse constructor??? Per UML int random; srand( time(0)); void advance(){ random = rand() % … | |
How can you do this in c++? |
The End.