49,761 Topics
| |
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 … | |
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 … | |
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 … | |
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 … | |
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 … | |
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 … | |
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 … | |
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; … | |
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 … | |
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 … | |
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; } | |
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 … | |
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 … | |
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 … | |
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 … | |
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 … | |
Can someone explain and give an example of how double hashing works. I understand linear, quadratic, and chain. | |
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 … | |
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 … | |
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 :) | |
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] | |
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 … | |
[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 … | |
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] | |
[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++) { … | |
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 … | |
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 … | |
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 … | |
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 … | |
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 … |
The End.