51,593 Topics

Member Avatar for
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
99
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
116
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
164
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
144
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
95
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
108
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
98
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
141
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
448
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
142
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
99
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
69
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
41
Member Avatar for sukhmani
Member Avatar for John A
0
30
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
76
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
77
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
145
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
107
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
121
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
99
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
147
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
292
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
187
Member Avatar for Escom

Hello, i need to make program which can do squaring, so x^n. I can do it with pow(x,n): [code]#include <iostream> #include <cmath> using namespace std; int main() { double x, c; int n; cout << "Alap = "; cin >> x; cout << "Kitevo = "; cin >> n; if …

Member Avatar for Escom
0
175
Member Avatar for shycode

Hello; I am doing a practice problem to write a program that allows a user to enter a number between 1 and 999. The code MUST be cutoff at 999 and no other numbers past that should work. I have developed a code, but it allows the user to enter …

Member Avatar for Salem
0
89
Member Avatar for guystangr

The program is suppose to [COLOR=#000000]1. [/COLOR][COLOR=#000000]Pull 5 offensive players into a file. Pull 3 defensive players into a file.[/COLOR] [COLOR=#000000]2. [/COLOR][COLOR=#000000]Sort both files by LAST name.[/COLOR] The error says error C3861: 'bubblesort2': identifier not found. [inlinecode] [COLOR=#008000]//Laura Patrick[/COLOR] [COLOR=#008000]//EGR 126-11[/COLOR] [COLOR=#008000]//March 20, 2007[/COLOR] [COLOR=#008000]//Ex 11.5 #6[/COLOR] [COLOR=#0000ff]#include[/COLOR][COLOR=#800000]<iostream>[/COLOR] [COLOR=#0000ff]#include[/COLOR][COLOR=#800000]<cstdlib>[/COLOR] [COLOR=#0000ff]#include[/COLOR][COLOR=#800000]<iomanip>[/COLOR] …

Member Avatar for Salem
0
95
Member Avatar for wujianwei

[HTML]Is there a way(function) to distingusih between different data types?[/HTML] If u can, provide me with the function code, please?:)

Member Avatar for vijayan121
0
115
Member Avatar for jrivera

I have a hw question that asks us to create an STL funciton that takes an argument of type map<string, int> and an integer and returns vector containin all positions in map for which the integer value is found. The function works from what I can test. But I wanto …

Member Avatar for vijayan121
0
132
Member Avatar for mcook228

Would somebody mind looking at this code and giving me some advice as to the copy constructor and assignment operator overload function? When I try to use this class in my program, I get the following error: error C2679: binary '=' : no operator defined which takes a right-hand operand …

Member Avatar for officerajesh
0
429
Member Avatar for jk_bscomp

hello,,,everyone,I just want to ask a list of sites to where i could learn GUI programming in c++ for the beginners like me.i hope you could help me about this one and be one of my circle of friends.you may just add me in your yahoo messenger jk_bscomp or e-mail …

Member Avatar for wise_monkey
0
99
Member Avatar for Menuhin

Hi, I have a file in the format of: First-Name Last-Name StudentNumber Grade1 Grade2 Grade3 Any student may up to 10 grades, and I want to read the information from the text file into a vector. My question is, how can I read the file into the vector so that …

Member Avatar for John A
0
84
Member Avatar for kylcrow

Hi, I am writing a function that needs to return either a R S or P. It works fine if what I am inputing is a R S or P. If something else is enter it acts funny. Any suggestions to help me out? [code=c++] char getUserChoice () { char …

Member Avatar for kylcrow
0
98
Member Avatar for banan

hi every one, im working on a project which is the assembler of SIC language,im using a mixture of c and c++ functions in my c++ program by including <stdio.h> and <iostream.h>header files.... my problem is that im reading from file,this file contains the source code of SIC language...i want …

Member Avatar for Ancient Dragon
0
85
Member Avatar for Slavrix

i have this simple program im writing to help my dads business. thoguh it doesnt seem to be working, this is what i have currently [code=c++] #include<iostream> using namespace std; int change(double money,int onedollar,int fiftycent,int twentycent,int tencent,int fivecent); int main() { int money, onedollar, fiftycent, twentycent, tencent, fivecent; cout << …

Member Avatar for WaltP
0
113
Member Avatar for rapperhuj

,DIV,TABLE,THEAD,TBODY,TFOOT,TR,TH,TD,P { font-family:"Nimbus Sans L"; font-size:x-small } --> ahmm hi everyone i'm a newbie here at daniweb.. but i have an unfinished business(project).. guys.. pls.. help me to solve this.. or give some comments or replies in my problem.. this is my problem.. i don't know what function/s should …

Member Avatar for Ancient Dragon
0
108
Member Avatar for wujianwei

[CODE]#ifndef HUGEINTEGER_H #define HUGEINTEGER_H class HugeInteger { public: HugeInteger(); void input(); int setNumber(char []); void output(); void convertToInteger(); void subtract(); bool isEqualTo(); bool isNotEqualTo(); bool isGreaterThan(); bool isLessThan(); bool isGreaterThanOrEqualTo(); bool isLessThanOrEqualTo(); bool isZero(); ~HugeInteger(); private: char a[41]; char b[41]; int *array1; int *array2; int result[41]; }; #endif [/CODE] [CODE]#include<iostream> …

Member Avatar for WaltP
0
108
Member Avatar for teh_man

Hey all, I was wondering could someone help me on writing a file to a notepad.exe file. What i need help on is i have a gam and i want to record how many times the player 1 & 2 has won lost or had a draw. How would i …

Member Avatar for Ancient Dragon
0
98
Member Avatar for Slavrix

[code=c++] void playAgain() { char again; cout << "Do you want to play again (y/n)?: "; cin >> again; if (again == 'y') chooseOption(); else if (again == 'n') cout << endl << "Thanks for playing Connect Four, the game of the clever people!"; else cout << "Invalid Choice" << …

Member Avatar for Slavrix
0
588
Member Avatar for Mac.Z

Hi, I can't get cin.getline to work properly, I'm using it inside a for loop.. it gets the input sucessfuly when the loop is executed for the first time(i=0), but it doesn't wait to take any input on the next times..the program just moves to the next line.. [code=c++] #include …

Member Avatar for John A
0
107
Member Avatar for tech291083

Hi, I have this program in C++ and I am struggling to understand as to why I am not able to store a value in an integer declared in the program as double within the acceptable range of [B]2.2e-308 to 1.8e308[/B]. Here this page also says so in a table: …

Member Avatar for Salem
0
399
Member Avatar for faiz

hi,i have to implement multiplication of two huge integers of 40 or more digits.i've made a function in a class for its implementation but its not working.plz help if u find any logical errors in it. [CODE]void HugeInteger::multiplyHugeIntegers(HugeInteger H1,HugeInteger H2) { int carry=0; int count=0; // introduced to place the …

Member Avatar for iamthwee
0
203
Member Avatar for Rob111

Hi there, I need to make a piece of code in C that 1. opens a specified file, 2. Reads the data in the file and separates it as shown below, 3. Converts the strings into integers and then perfoms some manipulation on them, 4. returns the new values to …

Member Avatar for Rob111
0
111
Member Avatar for matk

Hello, I found the code for bubble sort in C++. With the code below th[U][/U][URL="http://www.webmaster-talk.com/#"][/URL]e output will be: 23 8 7 6 6 5 2 2 1 Is it possible that sorts the numbers so the output will show all changes. In example: 9,6,5,23,2,6,2,7,1,8 9,6,23,5,2,6,2,7,1,8 .... .... .... 23,9,8,7,6,6,5,2,2,1 Thanking …

Member Avatar for matk
0
110
Member Avatar for Slavrix

hey guys i got this iece of code on a program i am writing, and i was jus twondering if you could help me to convert it so it uses the conditional operator to make it into a 1 line code, cheers [code=C++] int total, start, stop, increment; if (total …

Member Avatar for addicted
0
146
Member Avatar for Armfelt

Hello everyone, this is my first post. As can be quite rightly guessed, I am new to C++ and struggling with some coursework. My task is to produce a program that prints out 5000 random numbers between 1-5, also printing out the frequency of each given number. I have searched …

Member Avatar for iamthwee
0
2K
Member Avatar for Devster

Hi, Wondering if I could get some help. This program is supposed to : -Input student data(firstname,lastname,student#, and a vector of Grades(up to 10 grades) with a grade and assignment name(notworking)) from a text file and store it in a vector -Have a menu system for navigation -add a student …

Member Avatar for iamthwee
0
287
Member Avatar for T-Fizz

Hi, I have written a little prgrm to help me on my job. I want to now be able to use it on other machines than the one it was written on. I wrote it in Visual C++ .NET Express, downloaded from Microsoft, the free one. The machine I wrote …

Member Avatar for iamthwee
0
80
Member Avatar for m0dernist

Hi there, i writing this progam for my parallel port hardware but i could not solve my error.Plz help me...... fatal error C1057: unexpected end of file in macro expansion Error executing cl.exe.

Member Avatar for Salem
0
189

The End.