49,761 Topics
| |
[code] class HugeInteger { public: HugeInteger(); void input(); int setNumber(char []); void output(); void convertToInteger(); void subtract(); private: char a[41]; char b[41]; int *array1; int *array2; int result[41]; }; #include<iostream> #include<cstring> #include<cstdlib> using namespace std; #include "HugeInteger.h" HugeInteger::HugeInteger() { input(); } void HugeInteger::input() { cout<<"Enter the 1st Integer: "; cin.getline(a,70,'\n'); … | |
Is anyone here uses subversion to keep the C++ header and implementation files to the repository? I need your help... Pls reply.. Thank you... | |
How do I make C++ save the names entered by the user into another file on the computer??? [CODE][COLOR=#0000ff]#include[/COLOR][COLOR=#800000]<iostream>[/COLOR] [COLOR=#0000ff]#include[/COLOR][COLOR=#800000]<cstdlib>[/COLOR] [COLOR=#0000ff]#include[/COLOR][COLOR=#800000]<iomanip>[/COLOR] [COLOR=#0000ff]#include[/COLOR][COLOR=#800000]<string>[/COLOR] [COLOR=#0000ff]#include[/COLOR][COLOR=#800000]<fstream>[/COLOR] [COLOR=#0000ff]#include[/COLOR][COLOR=#800000]<vector>[/COLOR] [COLOR=#0000ff]using [/COLOR][COLOR=#0000ff]namespace[/COLOR][COLOR=#000000] std;[/COLOR] [COLOR=#0000ff]struct[/COLOR] players { string fname; string lname; [COLOR=#0000ff]int[/COLOR] atbats; [COLOR=#0000ff]int[/COLOR] runs; [COLOR=#0000ff]int[/COLOR] hits; [COLOR=#0000ff]int[/COLOR] doubles; [COLOR=#0000ff]int[/COLOR] triples; [COLOR=#0000ff]int[/COLOR] hrs; [COLOR=#0000ff]int[/COLOR] rbi; [COLOR=#0000ff]int[/COLOR] sos; … | |
ok after all of the grades and first and last names are entered, what do i need to do to get it to print the grades with the names out in order from heighest to lowest? [CODE]#include "stdafx.h" #include <fstream> #include <iostream> #include <string> using namespace std; const int MAX … | |
Is there a way to open, say, cout, and edit it to your own personal use? | |
ok i got my loop to work but i need to make it where the user has to enter a grade between 0 and 100, I tried by using [CODE] int grade(0<100);[/CODE] but it doesnt work. what do i need to do? also how do i get the program to … | |
ok I need this program to run the first and last names and the grades of 20 people. how would i set up a for-loop to do this. [CODE]#include "stdafx.h" #include <fstream> #include <iostream> #include <string> using namespace std; const int MAX = 3; struct Person { string Firstname, Lastname; … | |
Hello everyone, I am having trouble fine tuning my code. I like to have all the bulky parts of my main in functions, and I can not seem to figure out how to write this code as a function. Anyone tell me where to start? [code=c++] int main() { int … | |
I downloaded the installer for Visual C++ from the Microsoft website, and when I run it, I get this error message (below). Help me! | |
Ok, I'm a newbie. I've been reading through the [URL="http://www.cplusplus.com"]www.cplusplus.com[/URL] tutorials and now I've turned to doing simple exercises that I've found in free online resources and also ones that I've devised for myself. One of my first programs was a program that discovered prime numbers using nested [inline code]for[/inline … | |
[CODE=c]#include <iostream> #include <string> using namespace std; int main() { int i; int words = 1; string userString; cout << "Enter the text you want this fancy Word counter to count: " << endl << endl; getline(cin,userString); for(i = 0; i < userString.length(); i++) { if(userString.at(i) == ' ') words++; … | |
Hi iam having trouble with displaying my two dimensional array in columns eg. |Pie |Peach |Socks |$3.4 |$5 |$9 |Apple |Carrot etc... |$6.8 |$2 code //for(col = 0; col < COLSIZE; col++) for(row = 0; row < ROWSIZE; row++) { for(col = 0; col < COLSIZE; col++) //for(row = 0; … | |
how can i sort this file alphabetically by first name when in the program??? #include<iostream> #include<cstdlib> #include<iomanip> #include<string> #include<fstream> #include<vector> usingnamespace std; struct players { string fname; string lname; int atbats; int runs; int hits; int doubles; int triples; int hrs; int rbi; int sos; double avg; }; int main() … | |
[COLOR=#008000][/COLOR]after hours of trying (im really new to C++), i got a program to run that will find the mean, median, mode, and standard deviation of an array of numbers. However, if there is no mode (every number only appears once), it just returns the first number for mode. if … | |
hi all, my input file is an hexdecimal file, which is made by winhex. how can my c++ read from it and how can i deal with it. any links or tutorials will b helpfull thanks | |
I am new to C++ and programming in general, and am working on an upcoming homework assignment. I have run into several problems and would greatly appreciate assistance. The assignment is to write a code to determine area and volume in C++, using a While Loop. I am stuck with … | |
hi there, i am trying to make a client/server program for my project. i have created a menu that gives 3 options which in turn would take you to its corresponding method in my client. the method would run and send over some info to the server as a string. … | |
can somebody tell me how to save a date in the databse, from a datetimepicker in borland c++? please provide source code. Many Thanks priya | |
i have created chess in C++ usin MSDOS as os....i need to take screenshots but unable to do so....plz help me with this.... sukhmani | |
what are the interesting features of game programming in C++??? | |
c++, Debian linux system, g++ compiler Alright, I have a serious problem. I keep getting a segmentation fault everytime cin recieves a string with a period in it and stores it into a string. I used couts to find the location of the segmentation fault. it happens EXACTLY after [inlinecode]cin … | |
How do you kill and task in C++. Im using windows xp. And not using [code] system("taskkill [task.exe]"); [/code] thanks! | |
On emacs, the second indent is double the size of the first one! How do you change this? Is this some wacky gnu thing or is it standard? | |
Hi, I installed Dev C++ on my PC ...its the first time I am using it. Can somebody tell me how I can link and compile a .cpp and it's corresponding .h file to produce the required .exe ? I want to know how to build on Dev C++ basically. … | |
How to pass a 2D array by reference? Can somebody guide me? if I created an array as follows: char **sarray; 2Darray = new char* [row]; for(i=0; i<row; i++) 2Darray[i] = new char[col]; (NOTE: I get the values of row and colume via some calculations in my code ....basically, I … | |
I cannot figure out why my program gets the wrong output but I am assuming it has something to do with the array or the switch statement. Can someone guide me in the right direction? I am at a point where I am making no progress right now and now … | |
this is my function... [code=c++] int showScores(int player, int computer, int tie) { return ( cout << "User: " << player << endl << "Computer: " << computer << endl << "Ties: " << tie << endl;); } [/code] I get these error messages hw3b.cc: In function 'int showScores(int, int, … | |
bubblesort will not work for me [CODE] [COLOR=#008000] //Laura Patrick //EGR 126-11 //March 20, 2007 //Ex 11.5 #6 [/COLOR][COLOR=#0000ff]#include[/COLOR][COLOR=#000000] [/COLOR][COLOR=#800000]<iostream> [/COLOR][COLOR=#0000ff]#include[/COLOR][COLOR=#000000] [/COLOR][COLOR=#800000]<cstdlib> [/COLOR][COLOR=#0000ff]#include[/COLOR][COLOR=#000000] [/COLOR][COLOR=#800000]<iomanip> [/COLOR][COLOR=#0000ff]#include[/COLOR][COLOR=#000000] [/COLOR][COLOR=#800000]<string> [/COLOR][COLOR=#0000ff]#include[/COLOR][COLOR=#000000] [/COLOR][COLOR=#800000]<fstream> [/COLOR][COLOR=#0000ff]#include[/COLOR][COLOR=#000000] [/COLOR][COLOR=#800000]<vector> [/COLOR][COLOR=#0000ff]using[/COLOR][COLOR=#000000] [/COLOR][COLOR=#0000ff]namespace[/COLOR][COLOR=#000000] std;[/COLOR] [COLOR=#0000ff]struct[/COLOR] players { string fname; string lname; [COLOR=#0000ff]int[/COLOR] atbats; [COLOR=#0000ff]int[/COLOR] runs; [COLOR=#0000ff]int[/COLOR] hits; [COLOR=#0000ff]int[/COLOR] doubles; [COLOR=#0000ff]int[/COLOR] triples; … | |
"Write a program that has an array of at least 20 integers. It should call a function that uses the linear search algoritm to locate one of the values. The function should keep a count of the number of comparisons it makes until it finds the value. The program then … | |
[code] [COLOR=#0000ff]#include[/COLOR][COLOR=#800000]<iostream>[/COLOR] [COLOR=#0000ff]using[/COLOR][COLOR=#0000ff]namespace[/COLOR][COLOR=#000000] std;[/COLOR] [COLOR=#0000ff]const[/COLOR][COLOR=#0000ff]int[/COLOR][COLOR=#000000] ArraySize = 8;[/COLOR] [COLOR=#0000ff]int[/COLOR][COLOR=#000000] seqSearch([/COLOR][COLOR=#0000ff]int[/COLOR][COLOR=#000000] list[], [/COLOR][COLOR=#0000ff]int[/COLOR][COLOR=#000000] listLength, [/COLOR][COLOR=#0000ff]int[/COLOR][COLOR=#000000] searchItem);[/COLOR] [COLOR=#0000ff]int[/COLOR][COLOR=#000000] main()[/COLOR] { [COLOR=#0000ff]int[/COLOR][COLOR=#000000] index;[/COLOR] [COLOR=#0000ff]int[/COLOR][COLOR=#000000] intList[ArraySize];[/COLOR] [COLOR=#0000ff]int[/COLOR][COLOR=#000000] name;[/COLOR] cout<< [COLOR=#800000]"Enter 8 names: "[/COLOR] << endl; [COLOR=#0000ff]for[/COLOR][COLOR=#000000] (index = 0; index < ArraySize; index++)[/COLOR] cin>> intList[index]; cout<< endl; cout<< [COLOR=#800000]"Enter a name to search for... … |
The End.