49,766 Topics

Member Avatar for
Member Avatar for Bri426

I'm learning about arrays in my C++ class and am having some trouble with them. We have an assignment that states: Write a program that will: (1) Ask the user how many times a simulated pair of dice should be thrown. (2) Ask whether the user wants to see each …

Member Avatar for SgtMe
0
1K
Member Avatar for brycematheson

I'm creating a Tic-Tac-Toe game. Well, at least the beginnings of it. Currently, I'm trying to read a game board from a file, display it to the screen, and then write the contents back to a different destination file that the user selects. My problem is this: when reading the …

Member Avatar for WaltP
0
125
Member Avatar for TheebanRaj

Hi,friends...let help me to find relationship between 7404 and 1198..thanks

Member Avatar for WaltP
0
37
Member Avatar for maryamwiki

Any one can help me plz in writing programme to convert infix into postfix number

Member Avatar for SgtMe
0
31
Member Avatar for raider650

How would I output this into: int main() I've tried: int main() { PostTemperatures; } [CODE]struct WeatherStation { string StationName; double Temperature; }; void PostTemperatures(WeatherStation BigBasin,WeatherStation Foothill, WeatherStation DeAnza, WeatherStation MiddleField, WeatherStation RedwoodCity) { cout<< "Enter reported temperatures..."<<"\n"<< "\n"; BigBasin; BigBasin.StationName = "Big Basin"; cout << "Weather Station " << …

Member Avatar for raider650
0
73
Member Avatar for qvyhnl

Problem: write a function that returns a pointer to the maximum value of an array of double. I have written the code that return the maximum, but I don't know how to turn it into a pointer and return it =.= [CODE]#include <iostream> #include <string> using namespace std; const double …

Member Avatar for qvyhnl
0
113
Member Avatar for lochnessmonster

How do you all feel about class composition? say im making a class i would want to publish to the public for use...well if i perform class composition this means i would also have to implement the other classes/structs so the programmer can even properly use my class. Im just …

Member Avatar for mike_2000_17
0
191
Member Avatar for brycematheson

I'm writing a program that will eventually be a Tic-Tac-Toe game, but as for now, I just want to get the layout done. Right now, all it does is read the game board from a file, display it, and then ask you where you want to save it afterwards. I'm …

Member Avatar for Greywolf333
0
701
Member Avatar for rlhh

First of all, thanks for any help that I'll receive. Now on to the question. I'm wondering how do I create an array of an object in C++? I've done this in Java before but I've got no idea how to do it in C++. [CODE] import Accout.java private Account …

Member Avatar for rlhh
0
205
Member Avatar for jmcorpse

I need some assistance with my code. I figured it out and have it working for the most part. I just need some help in the carrying function where all the numbers that where added we carried over with paper and pencil type arithmetic. My biggest problem now is trying …

Member Avatar for daviddoria
0
99
Member Avatar for ade161

i need your help in creating a program that allows the user to enter a payroll code. The Program should search for the payroll code in the code in the file and then display the appropriate salary. If the code is not in the file, the program should display an …

Member Avatar for daviddoria
-1
156
Member Avatar for clayton69692000

hi guys i really need some help. Im trying to turn my index array into a multidimensional array and cant get it to compile. thanx for the help. [CODE]include <iostream> using namespace std; #include <cstdlib> #include <cstring> #include <iomanip> const int LIMIT = 10; const int MAX = 10; class …

Member Avatar for jonsca
0
97
Member Avatar for Nathaniel10

I have a difficulty I need help to overcome. I am developing a program that uses more than 1 class. Variables defined in one class are used in other classes. For example: [code] class X1 { private: int a; int b; public; X1() { a = 10; b = 20; …

Member Avatar for Nathaniel10
0
153
Member Avatar for triumphost

This is a program that is supposed to run on startup when the computer turns on... What I did was I put the name of the program in the RunOnce Registry key attached below... when u double click the key, it puts the program name in the registry telling it …

Member Avatar for triumphost
0
153
Member Avatar for modesto916

Hi everybody, here i am again ¬¬, I am doing an exercise that ask me to write a program to calculate this constant: e = 1 + 1/1! + 1/2! + 1/3! ... The user need to input how much the program must calculate. I wrote this code, but i …

Member Avatar for modesto916
0
175
Member Avatar for mariuam

this coding is in the class of set! Set::setDifference(int elements,int& z) { int a,b; z=(elements*a,elements*b); int temp; for (int i=0; i<=elements; i++) { *temp[i]=set[i]- z.set[i]; } return temp; }

Member Avatar for hag++
-3
105
Member Avatar for NathanMc

Hello. I'm running into a problem on an assignment I have for my C++ class. I've done similar things before with reading a file, but normally used a counter to know when to stop reading from a line and go on to the next, or code like this: [code] ifstream …

Member Avatar for hag++
0
174
Member Avatar for burcin erek

test program, dont understand after calling function it goes two times destructor "-5" is it wrong ? [CODE]#include <cstdlib> #include <iostream> using namespace std; class calculation { public: calculation(); // constructor ~calculation(); // destructor. }; calculation::calculation() { cout << "5"<<endl; } calculation::~calculation() { cout <<"-5"<<endl; } calculation function_one(calculation addition); int …

Member Avatar for burcin erek
0
100
Member Avatar for dophine

Hi all, I don't quite understand the program print the following output. [CODE] class D { public: D(int j):i(j){printf("default %d\n", i);}; D(const D& d):i(d.i){printf("copy %d\n", i);}; private: int i; }; int main(int argc, char** argv) { D d = 2; D d1 = D(23); } [/CODE] output: default 2 default …

Member Avatar for mike_2000_17
0
108
Member Avatar for Nandomo

I need an explanation on how to use 2 dimensional arrays displaying names. And single dimensional arrays for displaying letter and number grades. I need to make a self input gradebook for my students and do not know how to function it. I want them to input their names and …

Member Avatar for Nandomo
0
178
Member Avatar for ohsevenfiveoh

hey guys,been browsing this site for a few weeks,but this is my first post. As you might guess by my problem I'm a C++ noob. I'm tryin to make a program in which the user inputs an array of double, I then use bubble sort to to get it into …

Member Avatar for Fbody
0
610
Member Avatar for aaronmk2

Can someone explain and give an example of how double hashing works. I understand linear, quadratic, and chain.

Member Avatar for vanalex
0
65
Member Avatar for coolkid1093

I am doing a c++ project on cows and bulls where the computer has to guess the number. I have a few questions.? I recently heard of the pigeon hole principle( i am not exactly sure about how to use it)and I am trying to use this to do my …

Member Avatar for geethasree
0
120
Member Avatar for lochnessmonster

say i have a class which the user can make an object of by passing in 2 parameters. If the parameters entered are wrong how should i handle this? 1.) should i try to create the object,and then do the checking in the constructor? if the arguments are invalid then …

Member Avatar for geethasree
0
117
Member Avatar for KellieD

Hi, Would be very grateful if someone could tell me how to start an array by getting the program to ask you how many values you want to enter (the maximum being 50) Thanks :)

Member Avatar for KellieD
0
85
Member Avatar for hystaspes

What is the use of declarators in struct's definition? and what is a "tag declarator"? example from MSDN: [CODE] [template-spec] struct [ms-decl-spec] [tag [: base-list ]] { member-list } [declarators]; [struct] tag declarators; [/CODE]

Member Avatar for hystaspes
0
283
Member Avatar for claudiordgz

I guys, i have a problem with binary files A file is opened in the beginning of the main then a case to give the user a choice: 1.- Show the content of the file 2.- Search for a name 3.- Search for a type of crime 4.- Search for …

Member Avatar for claudiordgz
0
106
Member Avatar for xfreebornx

[CODE]#include <iostream> using namespace std; struct student { int ID; char name[80]; char nationality[80]; char gender[2]; }; void insert(student array[]); void Sort(student array[]); int main() { student array[100]; int answer; cout <<"Welcome to student recording system"<<endl; cout <<"Please choose one of the following option"<<endl; cout <<"1.Insert new record"<<endl; cout <<"2.Delete …

Member Avatar for A.Ali
0
284
Member Avatar for vedel

Hey Guys! I am vedel and this is my first Thread in this Community. My question is, how i can boot a c++ code? example code: [CODE] #include <iostream> using namespace std; int main() { cout << "Hello World!" << endl; return 0; } [/CODE]

Member Avatar for vedel
0
1K
Member Avatar for vbx_wx

[code] #include <iostream> #include <cstring> using namespace std; int main(int argc, char* argv[]) { const char* p = "1111"; int len = strlen(p) - 1; int a[len]; for(int i = 0; i <= len; i++) { a[i] = ~(p[i]- '0'); } for(int i = 0; i <= len; i++) { …

Member Avatar for gerard4143
0
94

The End.