49,761 Topics

Member Avatar for
Member Avatar for littlestone

For a singleton class, there is only one instance in a process, so it's not necessary to define a member function as static, am I right? Thanks in advance.

Member Avatar for dougy83
0
254
Member Avatar for allialli

[B]hi. can anyone please help me with this assignment?[/B] Write a function called divideMe which takes two integer parameters x and y and returns a double which is the division of these numbers (x / y). If y is zero, print the message "Divisor can not be zero!" and return …

Member Avatar for allialli
0
319
Member Avatar for Ryano24

I wrote this code to re-create the classic race of the tortoise and the hare and everything compiles fine. Just the logic is messed up. When I run the program all I see is BANG AND THEY'RE OFF and who wins. I should be seeing a T for the Tortoise …

Member Avatar for vmanes
0
1K
Member Avatar for sohamghosh

My code for address book is as follows: [code=cplusplus] #include <iostream> #include <cstring> using namespace std; struct { char name[101][30]; char telephone[101][8]; char email[101][20]; char address[101][50]; char postal[101][6]; }employee; void enter() { int n; cout << "Number of entries?\n"; cin >> n; for (int i=0; i<n; i++){ gets_s (employee.name[i]); gets( …

Member Avatar for sohamghosh
0
95
Member Avatar for aquariusdragon2

I have this coded out but it keeps giving me the error message "ifstream" does not have a type. I don't know what to do, sigh. Any help would get appreciated. const int MAXSIZE = 100; double votes[MAXSIZE]; // declaration for array double vote; int count = 0; double total …

Member Avatar for vmanes
0
141
Member Avatar for sommanatt

I have more fluently in writting Java but for this program my advisor need me to convert my program from java to c++. I've already done with c++ code and the result is correct and got the same result as java program but the big problem is that the program …

0
75
Member Avatar for stan.joe1

I wants to input a list of day temperatures and count the number of days with temperatures above 20 degrees. The C++ program below is supposed to do this and display the result. A temperature of -100 indicates the end of the data. #include <iostream> using namespace std; int main( …

Member Avatar for dmanw100
0
297
Member Avatar for Adrian99420

Hi, I created a GUI which contain a few tabpage, I wish to add and name a new tabpage with a single button click. Therefore, I created two window form. With the "add new operator" button, I link to the second form which allow user to key in the name …

Member Avatar for Adrian99420
0
87
Member Avatar for usiel

PLease can somone check it and give me some feedbacks [CODE]include <iostream> #include<iomanip> using std::cin; using namespace std; int max=100; void general_options(); void input(int A[], int maxValue); void input(int A[], int howMany); int count90 (int A[],int howMany); void add10(int [], int howMany); void printGrades(int [], int howMany); main() { //variables …

Member Avatar for usiel
0
92
Member Avatar for CE Student

This is my assignment I have to send it today and this week I have many test and I did not any time for solve it please please I need help ITCS102 Assignment #5(chapter 12) Create a class called Employee that maintains information about an employee in a company, each …

Member Avatar for Narue
0
134
Member Avatar for fusi0n423

Hi all I'm new here I've been working on a project that has a multiset class. I need a function that accepts a integer value and returns the value held there. The multiset is a data[SIZE][2] where everything is stored where data[i][0] is the number and data[i][1] is how many …

Member Avatar for fusi0n423
0
120
Member Avatar for cuddles23

Im working on this program: to write a program that displays the last 10 characters in an order that is reverse of the order they were entered... i've gotten this so far: #include <iostream> #include <string> using namespace std; int main() { string message; cout << " Enter a string …

Member Avatar for vmanes
0
94
Member Avatar for rustyj110

I am trying to create a text-based menu class to give myself a way to create more dynamic menus in programs. Basically the menu class has a vector of option classes that contain the menu-option's name, function to call etc. The problem is that I want to be able to …

0
61
Member Avatar for TPclan

I am an extreme new comer to C++. Currently I have written a short script in VBscript to delete two specific files on a specific day. This script is set in the start up menu so that it checks for the day of the week. If the day matches the …

Member Avatar for Arne Kristoffer
0
125
Member Avatar for Roebuc

I am working with classes for the first time. I am trying to make an address book. While I think I have done my header files and class definition files correctly, I am running into a snag with getting it to show on the screen. I went back to a …

Member Avatar for Roebuc
0
105
Member Avatar for DJ-KhaosTheory

Gretting fellow coders, I am making a RPG, and need some assistance with the MCI commands. I only have knowledge of namespace std, and any complex code without namespace will be over my head. I am using it for playing mp3 files. I need: the open player call the load …

0
77
Member Avatar for superjacent

I've just completed an exercise from a book wherein the task is to display a menu of choices each associated to an alphabetical character. The program is to reject invalid characters and only finishing when a valid choice is made. Below is my solution, it achieves the task but I'd …

Member Avatar for jade09091990
0
186
Member Avatar for navamous

I have to program an Address book program in C++. So far I've done about 40% of the assignment. The main requirements of the Address Book are the following (Which I am confused about are): 1. Display 20 Contacts at a time, using the space bar to go to the …

Member Avatar for Spagett912
0
215
Member Avatar for sopel39

suppose we have template class X and template function template <class A, class B> A* g (B&); how to make something like that? template <class T> class X { template <class A, class B> friend B* g (T&); }; i mean that g<A, B> () is only friend of X …

Member Avatar for vijayan121
0
107
Member Avatar for Skeezo

Hello when I try to compile my program I get these errors: 1>funding6c.obj : error LNK2019: unresolved external symbol "void __cdecl ContributorSort(struct Contribution * const,int &)" (?ContributorSort@@YAXQAUContribution@@AAH@Z) referenced in function _main 1>C:\Users\Big Z\Desktop\program 6\Debug\program 6.exe : fatal error LNK1120: 1 unresolved externals what could be causing this? [code=C++] #include <iostream> …

Member Avatar for Skeezo
0
423
Member Avatar for sjcomp

Hello, I'd like to split a string into smaller parts using delimiters that are longer than one character. I'm curious if boost::algorithm::split can be used for that. I can not figure out what predicate I should give it to compare strings [CODE=C++] #include <vector> #include <string> #include <boost/algorithm/string/split.hpp> std::vector< std::string …

Member Avatar for sjcomp
0
5K
Member Avatar for snakeman

I've created simple C++ ATL Web Service in VisualStudio 2005 Is it possible to host it in Apache or some another web server exept IIS? Any help will be really appreciated. Thanks

Member Avatar for Ancient Dragon
0
146
Member Avatar for dmanw100

I finally broke down and wrote my first header file, but one of my functions is acting a little weird... This function is supposed to convert from Celsius to Fahrenheit but whenever I call the function, it returns an incorrect value. Is there an easy way to multiply the float …

Member Avatar for dmanw100
0
108
Member Avatar for zaza_thegreat

please help to with this program by mainly using arrays and pointers ,... i need this program to check 2 matrix files "if they contain any character and if they contain cout<<"invalid"; " and to open them from .txt file [code=cplusplus] #include<iostream> #include<fstream> #include<string> #include<cmath> using namespace std; int main() …

Member Avatar for Nick Evan
0
195
Member Avatar for kux

plz take a look at the following code [CODE] #include <iostream> #include <string> #include <iostream> #include <string> using namespace std; class A { public: string sa; A(string sia); }; class B:public A { public: string sb; B(string sia, string sib); }; A::A(string sia):sa(sia) { } B::B( string sia, string sib):A(sia),sb(sib) …

Member Avatar for Agni
0
258
Member Avatar for toolbox03

Anyone knows how to capture the data pipe in from linux ls command in c++ program? the command is ls - ali and I need to pipe it to a c++ program by ls - ali|./a.out how do I code the main in c++ to capture the data? int main() …

Member Avatar for dougy83
0
155
Member Avatar for Lensva

hey again, code below works but it tends to give some info which shouldn't be there: (for example a - 0 where 'a' is a letter and 0 is the times the letter was repeated) [code=cplusplus] #include <iostream> #include <stack> #include <fstream> using namespace std; int main() { fstream fin1("E:\\iras.txt", …

Member Avatar for Lensva
0
201
Member Avatar for mikky05v

Write a program which will accept a Roman numeral input from the keyboard and return to the screen its numeric value. Some of you cases should input unusual or awkward input, and at least one trial must include an improperly formed Roman numeral. The following features of the Roman numeral …

Member Avatar for mikky05v
0
134
Member Avatar for ps.sohani

Hi All, We have a ACE server which listens to specified port on given IP and sends the required response to the server. This ACE server works correctly as a console application. But it gives problems when we try to integrate this ace server code in service program developed using …

0
49
Member Avatar for soka2oo7

I want to know how to develop a matrix calculator that preforms basic matrix operations usin g arrays and/or pointers. Iwant a calculator to do addition ,subtraction ,multiplication ,transpose,checking enquality, checking properties and matrix power & the program will read the data from a file & check if the data …

Member Avatar for soka2oo7
0
120

The End.