49,761 Topics

Member Avatar for
Member Avatar for DaniwebOS

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 …

Member Avatar for jonsca
0
105
Member Avatar for Lelly

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 …

Member Avatar for mike_2000_17
0
181
Member Avatar for NV43

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 …

Member Avatar for mike_2000_17
0
169
Member Avatar for Tinee

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 …

Member Avatar for Arbus
0
175
Member Avatar for daviddoria

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 …

Member Avatar for mike_2000_17
0
270
Member Avatar for nory22

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 .. …

Member Avatar for Arbus
0
184
Member Avatar for highflyer8

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?

Member Avatar for Fbody
0
311
Member Avatar for nalasimbha

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 …

0
159
Member Avatar for HashIncludeDotH

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 …

Member Avatar for HashIncludeDotH
0
1K
Member Avatar for Khoanyneosr

[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 …

Member Avatar for daviddoria
0
187
Member Avatar for Helmyano

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

Member Avatar for caut_baia
0
105
Member Avatar for saqi2926

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.

Member Avatar for saqi2926
-4
82
Member Avatar for highflyer8

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; } // …

Member Avatar for Fbody
0
532
Member Avatar for SourabhT

[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"); …

Member Avatar for SourabhT
0
157
Member Avatar for highflyer8

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 …

Member Avatar for dkalita
0
261
Member Avatar for Vindal

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: …

Member Avatar for Vindal
0
168
Member Avatar for mpike

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 …

Member Avatar for WaltP
0
165
Member Avatar for triumphost

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 …

Member Avatar for Ancient Dragon
0
90
Member Avatar for maybnxtseasn

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,....... ); ......... ........ …

Member Avatar for mike_2000_17
0
113
Member Avatar for AODfan

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. …

Member Avatar for AODfan
0
123
Member Avatar for ashrafu1

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 …

Member Avatar for ashrafu1
0
475
Member Avatar for failbot

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. …

Member Avatar for arkoenig
0
83
Member Avatar for sdr001

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 …

Member Avatar for sdr001
0
106
Member Avatar for d0csss

#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); } …

Member Avatar for Chilton
0
88
Member Avatar for dahaker

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 …

Member Avatar for dahaker
0
3K
Member Avatar for lochnessmonster

if a constructor OR public member function throws an exception, will the objects destructor be called automatically?

Member Avatar for mike_2000_17
0
98
Member Avatar for pseudorandom21

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?

Member Avatar for triumphost
0
90
Member Avatar for chaosgeneration

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 …

Member Avatar for chaosgeneration
0
127
Member Avatar for mitrious

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 …

Member Avatar for mitrious
0
156
Member Avatar for sirko

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 …

Member Avatar for sirko
0
241

The End.