49,761 Topics

Member Avatar for
Member Avatar for wujianwei

[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'); …

Member Avatar for iamthwee
0
140
Member Avatar for squinx22

Is anyone here uses subversion to keep the C++ header and implementation files to the repository? I need your help... Pls reply.. Thank you...

Member Avatar for jwenting
0
115
Member Avatar for guystangr

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; …

Member Avatar for Infarction
0
78
Member Avatar for bigben09

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 …

Member Avatar for Lerner
0
90
Member Avatar for linux
Member Avatar for Nick Evan
0
103
Member Avatar for bigben09

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 …

Member Avatar for Ancient Dragon
0
92
Member Avatar for bigben09

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; …

Member Avatar for WaltP
0
112
Member Avatar for kylcrow

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 …

Member Avatar for Madzts
0
162
Member Avatar for linux

I downloaded the installer for Visual C++ from the Microsoft website, and when I run it, I get this error message (below). Help me!

Member Avatar for WolfPack
0
141
Member Avatar for mkramer

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 …

Member Avatar for ~s.o.s~
0
93
Member Avatar for alejo

[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++; …

Member Avatar for alejo
0
104
Member Avatar for sInFuL69er

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; …

Member Avatar for alejo
0
93
Member Avatar for guystangr

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() …

Member Avatar for guystangr
0
126
Member Avatar for Ortal

[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 …

Member Avatar for Ortal
0
445
Member Avatar for ghadahelal

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

Member Avatar for Salem
0
77
Member Avatar for bmgee13

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 …

Member Avatar for ~s.o.s~
0
138
Member Avatar for fatboysudsy

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. …

Member Avatar for Ancient Dragon
0
97
Member Avatar for Priya.K

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

Member Avatar for Ancient Dragon
0
68
Member Avatar for sukhmani

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

Member Avatar for Ancient Dragon
0
39
Member Avatar for sukhmani
Member Avatar for John A
0
29
Member Avatar for FireSBurnsmuP

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 …

Member Avatar for FireSBurnsmuP
0
1K
Member Avatar for virus.exe

How do you kill and task in C++. Im using windows xp. And not using [code] system("taskkill [task.exe]"); [/code] thanks!

Member Avatar for Ancient Dragon
0
75
Member Avatar for Sturm

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?

Member Avatar for Infarction
0
75
Member Avatar for B.Y

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. …

Member Avatar for ~s.o.s~
0
141
Member Avatar for B.Y

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 …

Member Avatar for John A
0
103
Member Avatar for -_00_-

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 …

Member Avatar for -_00_-
1
112
Member Avatar for kylcrow

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, …

Member Avatar for iamthwee
0
96
Member Avatar for guystangr

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; …

Member Avatar for iamthwee
0
145
Member Avatar for xexex

"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 …

Member Avatar for flexeblesteel
1
284
Member Avatar for lionburn50

[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... …

Member Avatar for Salem
0
184

The End.