49,761 Topics
| |
Regardless of what I do, the program won't run without crashing... any luck on how to fix it? [CODE]#include <iostream> #include <string> using namespace std; class DayOfTheWeek { public: void setDay(string); void printDay(); string getDay(string&); string plusOneDay(int); string minusOneDay(int); string addDays(int); private: int day; int toNumber(string); string toName(int); }; int … | |
Hello, I started my homework and I couldn't complete it. Can anyone help me with it?? the question is: Implement the depth-first search algorithm so that it accepts input from text file in the following format: List all distinct vertex symbols (use just a single symbol: A-Z and 0-9) one … | |
In my set.h file - template(class T): [CODE]template<class T> class set { public: void add(const T& item); private: } #include "set.template"[/CODE] In my set.template file: [CODE]template<class T> void set<T>::add(const T& item)[/CODE] In my main.cc file (where cset1 and cset2 are both set<char>): [CODE]cset1.unian(cset2);[/CODE] The error: [CODE]error: no matching function for … | |
I have made a program which the user will input the total inputted numbers and record it as an array, sort the biggest and smallest number, post the original inputted number, reverse the original's order, and lowest to high order. I have done the recording, sorting, however, when the program … | |
I am working on some code (not written by be, and too big to fundamentally change the structure of) where a pure virtual Image class is implemented. The user is expected to implement a function of their derived Image class with signature: [code] virtual Rgb* GetRgb(); [/code] Where the Rgb … | |
Hi there i have wrote a program ,The user can only Choose the letter S for square or R for rectangle.. i have done every thing as you can see ... the only problem that am having is if the user puts 's' small letter also 'r' small letter .. … | |
Any method (within a C++ class) that prints to a file or to a screen has a return type of void. What role does the keyword [I]void[/I] perform? | |
| Hello, I am writing a program that integrates a function and returns the integrated value. The integration is to be performed from 0 to an upper limit which I specify. But the function I am integrating does not allow 0 to be used as the lower limit, as using 0 … |
Hello, I am required to implement a 1D then 2D DFT on an image. The problem is, I can implement both 1D & 2D DFT on a 2D array and it produces the "right result" except: 1. my answer often floats in 0 i.e. [code] for(int u = 0; u … | |
[CODE] #include <iostream> #include <ctime> #include <cstdlib> #include <string> #include <algorithm> using namespace std; //Types and Arrays string word[16] = {"GOLDFISH", "COMPUTER", "ANONYMOUS", "JACKET", "SHARP", "SERVICE", "EFFORT", "CHARACTER", "CHANGE", "WITHOUT", "PRODUCT", "UNFOLDING", "MUSIC", "MOMENT", "LIFETIME", "PROVIDE"}; // words that will be randomized. string hint[16] = {"Small colorful fish.", "A machine … | |
in the following code [CODE] class obj { protected: int somedata; public: obj (int x) {somedata=x;} }; [/CODE] i want to make another child class form this one and inherits the constructor plz help | |
Make following function of the string class with out using built in functions: Make a function that will combine data of two strings and save it in the third string. | |
Compiling the following the class in the main program returns error C2784. What could be causing the problem? [CODE]#include <iostream> // Include input/output stream #include <cmath> class threevector { public: double xcoord, ycoord, zcoord; // Default constructor threevector() { xcoord = 0.0; ycoord = 0.0; zcoord = 0.0; } // … | |
[CODE] #include "stdafx.h" #include<iostream> using namespace std; class Base { public: virtual void fun() { cout<<"base"<<endl; } }; class Der:public Base { public: void fun() { cout<<"Der"<<endl; } }; void func(Base b) { b.fun(); } int _tmain(int argc, _TCHAR* argv[]) { Base b; Der d; b.fun(); d.fun(); func(b); func(d); system("pause"); … | |
I have seen the following in a abook: "The argument(s) of a method can be any type of object (as long as its class has been made available to the program), as well as the predefined default types of variable. For example, methods in our three-vector class are not limited … | |
I need to be able to loop and get information for up to 10 "BankAccount" arrays, but when I use less than 10 it gives me garbage and I don't know how to fix it. Here is my Code. [CODE]#include <iostream> #include <iomanip> using namespace std; class BankAccount { private: … | |
Ok so a friend of mine came up with this code to create a highscores list for a game when i run it, it works perfect you can see everything fine. the problem comes when it tries to reopen the file again. The file has abunch of gibberish inside and … | |
KK I've been using mouse_eventf for clicking buttons in another application.. To do this I've done GetClientRect to get the size of the client and then click the button at a certain distance from one edge of the client... What I noticed that is that if the user's computer is … | |
im wanting to make a class called Log. with the template as follows class Log { private: std::ofstream outputFile; SYSTEMTIME systemTimeBuffer; public: Log( std::wstring error1 ); Log( std::wstring error1, std::wstring error2 ); Log( std::wstring error1, std::wstring error2, std::wstring error3 ); Log( std::wstring error1, std::wstring error2, std::wstring error3,....... ); ......... ........ … | |
The program is supposed to pull in data from an input file and sum numbers and not exceed 1000 and then stop, but it seems that my code is making it not calculate properly, it is less than it is supposed to be, but doesn't add to what is present. … | |
hello me and my friends were assigned to make a program that can add,delete,update and show information. we were able to make this code ( am sending u ) but we cannot solve some problem like the after adding or deleting or any other work the window does not goes … | |
Hello, I am creating an implementation of LIST that displays a list of 4 elements and also displays them in reverse. It seems to be correctly displaying the first list but I am getting a segmentation fault error before it displays the reverse list and I am not sure why. … | |
Hello. I am trying to figure out why my program has an infinite loop :/ The program asks a user how many digits they want their numbers to be and then the program needs to print out all binary numbers for the user inputted digits. For example: User inputs 3 … | |
#include <iostream> #include <cmath> using namespace std; class Rectangle { public: int width, height; Rectangle(); ~Rectangle(); double r_area(); double r_perimeter(); }; Rectangle::Rectangle() { width = 1; height = 1; } Rectangle::~Rectangle() { } double Rectangle::r_area() { return (width * height); } double Rectangle::r_perimeter() { return (2*width + 2* height); } … | |
Hi guys im making this homework on a program that the user will input the time in seconds and it will calculate the velocity and acceleration based on these formulas. Ive tried to compile the program but im getting 2 times "an illegal else without matching if" now the error … | |
if a constructor OR public member function throws an exception, will the objects destructor be called automatically? | |
Is there a way to store binary code in memory (as a value) then execute it? For instance if I have an array of bytes I have filled with the binary code of say, a .exe, is it possible to execute it? | |
Hey all, I'm currently working on a project that exemplifies matrix multiplication algorithms. My problem isn't working on the algorithms, but more of the structure of the classes. If any of you wouldn't mind looking over my code and helping me get a little more familiar with how things should … | |
I'm implementing a bi-directional iterator for a class (a simple list that holds strings) ... the book I'm using asked me to do so ... (I'll have to implement a version of the standard list class afterwards) ... but my iterators just won't work... here's what I have my iterator … | |
Here's the deal. I need program to read from text txt file and then write numbers into one file and letters into the other... I figured how to read and write to file (using iterators) but I can't figure out how to make the program sort numbers from letters. #include … |
The End.