49,761 Topics

Member Avatar for
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
110
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
186
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
696
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
201
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
93
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
151
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
152
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
172
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
104
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
165
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
99
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
106
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
177
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
605
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
119
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
115
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
82
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
280
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
104
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
282
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
Member Avatar for sadsdw

Hi everyone, I'm recently in C++ and I would like to develop one C++ code that read a file ".txt" of strings and numbers with different size of columns and lines. After I need to get the frequencies of each element of the same column. Cheers, SADSDW Example: ABC DEF …

Member Avatar for Fbody
0
116
Member Avatar for rebellion346

Im having issues trying to get this to work. I think the problem for my Meet and Join functions is its printing out the C array inititalized to all 0's and not the modified C array after all the calculations have been done. Also, I don't think my for loop …

Member Avatar for mitrmkar
0
2K
Member Avatar for Tsunami49

Hi there. I am currently trying to get my head around using classes across two files. I currently have a super class and a sub class stored in a file and the main function in another. When I try and pass arguments to the class they work fine if the …

Member Avatar for Tsunami49
0
135
Member Avatar for sarfu

Hello every coder. i want to know if it is possible to send data (text/char) over internet using c++ . can i use winsock send function as i could see on msdn winsock send is used to send data to the server, hence i started coding using winsock, i was …

Member Avatar for Duongpv
0
772
Member Avatar for nerdygirl118

Hello. I am making a wheel of fortune game and am getting stuck. This loop keeps repeating the first line "Incorrect input. You can only pick a vowel." Also, I can't get the phrase to read the vowel and say, "Sorry, this vowel was already revealed." If the vowel was …

Member Avatar for WaltP
0
233

The End.