49,761 Topics

Member Avatar for
Member Avatar for Skeezo

What i am trying to do is pass an array of structs to a function. the code i have so far follows: [code=C++] struct Contribution { string name; double amount; }; const int MAX = 25; typedef Contribution BigSpender; typedef BigSpender ContributionRec[MAX]; const string NAME_FILE = "names.txt"; const string CONTRIBUTION_FILE …

Member Avatar for vmanes
0
83
Member Avatar for hgedek

Hi.I need an answer to my heap problem. I am creating a 1000 items priority_queue (priority_queue<Molecule*,vector<Molecule*>,SortClass>); Sometimes I need deleteThis(Molecule *mol) function.So this function can delete any item at any index.Pop wont work here if I dont use pop-push until the target.But this takes long time.So I want to learn …

Member Avatar for vijayan121
0
275
Member Avatar for nurulshidanoni

I have this programming but I want to sort the total in descending order... How to make an examid together with total after has sort the output? [code=C++] #include <iostream> // std::cout #include <fstream> #include <iomanip> #include <string> // std::string #include <vector> // std::vector<> #include <algorithm> //std::for each() using namespace …

0
59
Member Avatar for curt1203

I am on my last assignment and i have no idea how to do or start this one. This class has gotten to where i understand nothing when i watch the lectures. I have invested so much time trying to learn this stuff and i do not get structs. This …

Member Avatar for big24fan
0
94
Member Avatar for chemicaldave

I'm being given the assignment of using the selection sort method to alphabetize a 2D array of names. Specifically I am supposed to modify a selection sort algorithm for integers and convert it for my purposes. I took the skeleton code and tried to convert it. The program compiles and …

Member Avatar for chemicaldave
0
137
Member Avatar for cpp_noobsauce

Hi, I was given this problem: "The user will enter two letters. These letters will be stored in a string using cin.getline. Replace the first letter entered with the second letter entered." The next problem we have will be to replace the letters in a sentence, but I'm stuck on …

Member Avatar for cpp_noobsauce
0
83
Member Avatar for cscode001

Hello. I am new this website and a beginner in Computer Science. I have very little experience in C++. Recently I have been working on this lab and I am stuck at a point where I don't know what to do. Can any1 help me with this code? Here is …

0
44
Member Avatar for tigger0484

using visual studios C++ express 2005 edition this is my code but when I run it I get a bunch of garbage...any suggestions would be greatly appreciated!!!! [code=cplusplus] #include <iostream> #include <fstream> using namespace std; int length(char phrase[]); void concat(char phrase1[], char phrase2[], int measure1); void copy(char phrase1[], char phrase2[]); …

Member Avatar for tigger0484
0
261
Member Avatar for mofoparrot

Hey guys, I'm new here, I looked through the help also searched and couldn't find anything that helped. Although I will be using the Algorithms you guys have on this site. anyways I only took a intro course to C++ about four years ago and don't remember much I wrote …

Member Avatar for mofoparrot
0
130
Member Avatar for ericisshort

This is probably the most frustrating thing in c++ for me. I can handle compile errors just fine, but when I get a core dump, I get so frustrated, because I have no idea where the problem is, especially when I have 300+ lines of code to be looking at. …

Member Avatar for mitrmkar
0
99
Member Avatar for ITJohn89

hi my name is john i have been trying to learn how to design my own software. i have been told in order to i must learn c++ i have just download Visual C++ Express Edition am not to sure what i am doing so if anyone could give me …

Member Avatar for mitrmkar
0
115
Member Avatar for Black Magic

Hey i've made a simple calculator, but i was thinking about adding a square root option.. But is there a actual way to do this or would i have to create my own?? PLEASE REPLY A.S.A.P

Member Avatar for hammerhead
0
132
Member Avatar for DigitalPackrat

I searched the forums for Windows API tutorials and have found [URL="http://www.winprog.org/tutorial/"]this[/URL]. Is it necessary to do everything manually like in the tutorial and after getting the hang of it move on to QT or should I jump into QT right now?

Member Avatar for eager
0
249
Member Avatar for n8makar

sort of a noob as i have been doing c++ for only a couple months now. my problem is that i am using a function to pass data from a file into an array then into a .out file. the function im using to read the data from the file …

Member Avatar for vmanes
0
516
Member Avatar for wiggles

I have to write a computer program to play connect 4 against a human player by friday. I have no clue even where to start on this. I have already written the game, i just dont know what to do about the computer player. Please Help me!!! p.s. What is …

Member Avatar for Narue
0
2K
Member Avatar for daviddoria

I keep getting this error: this application has failed to start because MFC80.dll was not found. In the past, when I've got this error i've played around with "Runtime library", switching it from /MDd to /MD to /MTd......etc etc then I turn off and on the manifest files then I …

Member Avatar for daviddoria
0
103
Member Avatar for swaret

Hi all! i write because ive a little problem with a c++ binary tree. I wrote all the cose, and the program runs, but i have a dubt: the destructor and the copy constructor. i wrote in 3 files: nodo.h, albero.h and albero.cpp (nodo means node, albero means tree) [code] …

Member Avatar for swaret
0
127
Member Avatar for octavia

what kind of variable is UINT anyway..........? in VC++ Anyone can help me? I still cann't understand it's detail usage. :-/ :icon_question:

Member Avatar for Narue
0
327
Member Avatar for buvnut

hi there i was wondering if any1 could help me with this problem. i am a beginner at c++ and my coursework is asking me to create a program with a hash function and i am lost! could any1 tell me how to implement this? here is my problem - …

Member Avatar for Narue
0
107
Member Avatar for RatherBeInVegas

I have a program that provides different responses each time it is ran. I created it via an empty project and the output is simple cout statements to the DOS window. Is there a way to convert a C++ program I created into an Windows application that displays output and …

Member Avatar for William Hemsworth
0
103
Member Avatar for daviddoria

I seem to be able to write as many characters as I want into "buffer" even though I declare it as length 1 - why is this? [code] string teststring = "teststring"; cout << teststring << endl; char buffer[1]; itoa(34567,buffer,10); teststring.append(buffer); cout << teststring << endl; [/code] Thanks! Dave

Member Avatar for Narue
0
110
Member Avatar for sohamghosh

I was just asking, is it also possible to define 2D arrays? If so, how do I pass them into the functions and use them in an address book? As in can I say employee.name[x][] when I use things like strcmp, puts, or gets, or must i say employee.name[x]?

Member Avatar for Narue
0
78
Member Avatar for i_raghuveer

Problem Description: You are to write a golf game that allows the user to play one hole, a 280 metre par 5. For each swing, the player chooses a club and then the program generates the distance hit for each shot, updating the distance to the hole accordingly. Play proceeds …

Member Avatar for i_raghuveer
-1
127
Member Avatar for timdog345

I need to use a for loop to print out the odd numbers between 25 - 1. program2 1) I also need to use a for loop to prompt user to input two intergers: firstNumber and secondNumber (firstNumber must be less then secondNumber) 2) Outputs all odd numbers between firstNumber …

Member Avatar for hammerhead
0
124
Member Avatar for Aashath

Hi All, This is regarding VC++ 6.0 compilation problem that i have faced . I deleted my "Temp" folder and trying to compile my code , but VC++ doesnt allow me to compile my code without that folder .can anyone help me in this ? why VC++ requires temp folder …

Member Avatar for Ancient Dragon
0
107
Member Avatar for Sky Diploma

Hi all, I am currently working on a program which tests whether 2 numbers multiplied produces a PALINDROME. An example of a palindrome is 16461 which can be read same from both ways hence i devised a test. [CODE=cplusplus]#include <iostream> #include <string> using namespace std; char pali(char orig[100]); int main() …

Member Avatar for Sky Diploma
0
161
Member Avatar for allialli

i am having problems with this assignment : Write a program that prints an N by N box on the screen as follows: Please enter a number between 2 and 10: 5 ----- | | | | | | ----- Press any key to continue . . . Note that …

Member Avatar for WonderWomen204
0
98
Member Avatar for lianaconda

What's the best way to swap two arrays? Would it be better to copy each position into a new array and then assign the array a new name? Or would it be better to use pointers? What would the algorithm be if I were to use pointers or a dynamically …

Member Avatar for dougy83
0
113
Member Avatar for DevC++4.9.9.2

Hey, im trying to use pointers with a struct. I am having an issue in the function searchData. I can not get the pointer to compair with the string, it is still just compairing the actual adress or something else. Not sure if i even passed it right. Please help …

Member Avatar for VernonDozier
0
163
Member Avatar for binnaman

this is what I have so far. I did most of the work just that my output is screwed [code=cplusplus] #include <iostream> #include <fstream> #include <stack> #include <cmath> #include <cassert> using namespace std; int number(); bool Valid( stack<int> s, int row){// This will find out if there is a valid …

Member Avatar for Nick Evan
0
143

The End.