49,761 Topics

Member Avatar for
Member Avatar for j_williams18

Can anyone help me. I have a c++ project to do. The program must simulate a vending machine. I will post what i have so far. a data file must be hardcoded into it which provides the different drinks.[code]#include <iostream> #include <fstream> #include <string> using namespace std; const int SIZE=54; …

Member Avatar for j_williams18
0
605
Member Avatar for Stefano Mtangoo

please help me with this error: [COLOR="Red"]obj\Release\main.o:main.cpp:(.text+0x1c)||undefined reference to `__imp__CreateCWMp3@0'|[/COLOR] what is missing? I'm trying to compile [URL="http://www.inet.hr/~zcindori/libwmp3/index.html"]this[/URL]

Member Avatar for Stefano Mtangoo
0
237
Member Avatar for jacline

Hi to all, I have a homework about a banking system. I try to adding a branch in an array and the size of array dynamically increased. Here is my code but it gives run time error. [CODE]#include "BankingSystem.h" #include "Branch.h" #include <iostream> using namespace std; BankingSystem::BankingSystem(){ size=0; branches=NULL; } …

Member Avatar for jacline
0
12K
Member Avatar for iDevelop

I'm new to using C++ but I thought I would give it a try. The goal is to delete all files and folders located in %userprofile%\Local Settings\Temp without deleting the folder called "Bluezone" located in the Temp folder. Any help would be appreciated.

Member Avatar for Excizted
1
94
Member Avatar for Sseeth

[CODE]string lastNames(string name[],int SIZE){ stringstream ss; for(int i = 0; i < SIZE; i++){ ss << '"' << name[i].substr(0) << name[i].erase(name[i].find(',')) << '"' << " "; } return ss.str(); }[/CODE] this is outputting my list of names correctly other than all the names come out twice like "namename" how can …

Member Avatar for Sseeth
0
100
Member Avatar for Excizted

Hello all :) I'm working on a DLL with various of functions I later need in other applications. I have many classes, and most of them I need a global instance of. I've tried various things such as a singletonptr, singleton, global instantiation. What I need to achieve is the …

0
47
Member Avatar for teddy78

I have a code that uses queue in c++ and 3 class Message, MessageSender, and MessageReceiver to express queue content. The program runned but it expressed wrong output as I hope. I inputted 3 message object but queue expressed no messages received. Please help me find errors. I think this …

Member Avatar for teddy78
0
455
Member Avatar for mindgames

Does memory allocated for built-in types (in particular int, float and double) with the new operator initialize them to 0 (or 0.0, as the case may be)? Just trying to remember. (I seem to remember that new invokes a constructor even for the built-in types, but i'm not sure).

Member Avatar for mindgames
0
79
Member Avatar for Stefano Mtangoo

Hi all, I use codeblocks to compile a simple project (actually an example) from [url]http://www.inet.hr/~zcindori/libwmp3/libwmp3.html#playc++[/url]. I have included the .h file and I fail to include .lib/.a I keep getting error[color=red] ld.exe||cannot find -libwmp3|[/color] Is there a missing thing?

Member Avatar for Stefano Mtangoo
0
101
Member Avatar for NitaB

Just wanted to say thanks to everyone who gave input on that horrid assignment I had a couple of weeks ago! Anyway, I am back with new problems. To start, I just want help correctly writing out one particular void function which I am calling readLetters. Okay, so I wrote …

Member Avatar for NitaB
0
680
Member Avatar for T-Dogg3030

I am trying to use an array that can change in length by the number in the command line. Arrays must be constant at the time of declaration. Can anyone help? [CODE] using namespace std; int main (int argc, char *argv[]) { int nulls=atoi(argv[2]); int arry[nulls]; } [/CODE]

Member Avatar for Narue
0
197
Member Avatar for eranga262154

Hi all, I just want to write a simple proxy to redirect client to different URLs. Say all users call the proxy server with the same URL and the proxy server redirect them to different URLs. How can I do such thing, can you please anyone comment on this. Thanks …

Member Avatar for jencas
0
111
Member Avatar for basilc

Hey there, first time posting. I have a program that is kinda put together from a program to generate polynomials and evaluate them and a program to do bisection to solve for the root. It may be a mess. The problem is, i believe, when I try to use the …

Member Avatar for programmersbook
0
157
Member Avatar for ivanhny

I'm a student having trouble with creating two vectors of objects for a homework assignment. The first vector creates fine, and prints out the values it imports (readM). The program hangs on the second vector(readT). I've checked the text files and they seem ok. I even tried substituting a simple …

Member Avatar for jonsca
0
154
Member Avatar for UberJoker

Hey guys. I apologize for my sloppy code. But it got a bit longer than i expected so i stopped bothering about giving meaningful names to Variables later on in the program. Below I have a AVL tree(atleast that's what I intended to write). But my approach to it was …

Member Avatar for UberJoker
0
110
Member Avatar for ganmo

Hi I've been struggling with this for a very long time now. And I can't seem to get it done. I want to make an array, dynamic allocted array. Which act something like an vector (I know c++ has vector). So my approach was to create a [B]list_add() [/B]function. Its …

Member Avatar for mrnutty
0
124
Member Avatar for Dannyo329

How do you make a C++ Program run at start up? I'm using Vista, and when I right click the start button and press open, it comes up with my programs in the start menu, how do I get to the Start up Folder?:S

Member Avatar for jonsca
0
96
Member Avatar for mksakeesh

Hi, I have an text file "CD details" with content as below 1~ Cast Away~ English~ Thriller~ U~ 2~ Titanic~ English~ Romance~ A~ 3~ Forest Gump~ English~ Life~ U~ I am trying to add some additional data to the start of each line by using a code as below [code] …

Member Avatar for mksakeesh
0
97
Member Avatar for SurviBee

I'm attempting to implement the trapezoidal method of calculating the integral of a curve. It's supposed to be the measure of water flow out of a tank's release valve. The water flow is a function of time in seconds where Y is the rate of discharge and X is time. …

Member Avatar for sweetkim_2008
0
198
Member Avatar for Jalwes

Could anyone tell me why this code read an extra line? It duplicates some of the last line, only it changes the number. For example, the text file (set up as an inventory file) reads: 45 car 23 bus 1 truck 4 van After running the program, it displays that, …

Member Avatar for Lerner
0
94
Member Avatar for cnote1287

I have a file of data that was put into a data file by another program with the same struct. for this program i want to take that data out of the .txt file and put it back into the struct array. is there any big code that is wrong …

Member Avatar for cnote1287
0
115
Member Avatar for noey699

right now I am using slope calculations to determine the direction a selected unit needs to go basically the equation is (x2 - x1) / (x2 - x1) + (y2 - y1)to calculate the ratio of change in x to the total change in position. (y2 - y1) / (x2 …

Member Avatar for mrnutty
0
76
Member Avatar for plobby

I have an issue with a function not working properly in my code -- It is a calendar creating program and when I call the function from the menu it blips the first line of text that it outputs to the user (asks a question for some input) and then …

Member Avatar for jonsca
0
100
Member Avatar for sexyzebra19

I'm trying to implement the algorithm described here under 'definition', [url]http://en.wikipedia.org/wiki/Laguerre%27s_method[/url] To summarise it takes an initial guess 0, and then iterates to find the root. In lines 68 to 71 I was hoping this would exit the function, i.e. when the root is found...but it's still carrying on. Can …

Member Avatar for Clinton Portis
1
202
Member Avatar for icygalz

computeCube function is correct, but the main function has a problem. Explain why it doesn't work and show how to fix it. Your fix must be to the main function only; you must not change computeCube. [CODE] void computeCube(int n, int* ncubed) { *ncubed = n * n * n; …

Member Avatar for icygalz
-3
181
Member Avatar for icygalz

[CODE]void findMax(int arr[], int n, int* pToMax) { if (n <= 0) return; // no items, no maximum! int max = arr[0]; pToMax = &arr[0]; for (int i = 1; i < n; i++) { if (arr[i] > max) { max = arr[i]; pToMax = (arr+i); } } } int …

Member Avatar for Narue
1
4K
Member Avatar for spear64

Write a C++ program that asks a teacher to input the number of students who took an exam and the scores for each student who took the exam. For each letter grade, determine the number of scores. Print to the screen the exam scores and the number of scores in …

Member Avatar for jbisono
0
116
Member Avatar for KOFSoldier

Me and a friend have been trying desperately to get this done, but we barely know where to start. We know we need the ifstream to read in from the file, but that's about it. Anyone got any tips for us, please? (Note: we're both fairly new to programming, so …

Member Avatar for KOFSoldier
-4
178
Member Avatar for spear64

[CODE]#include <iostream> using namespace std; void acceptedScores(int numOfstudents); int printedScores(); int main() { int students; int numStudents; int scores; int numOfStudents[100] = students; char cont; cont = 'y'; cout << "Would you like to begin (Y or y)" << endl; cin >> cont; while(cont=='Y' || cont== 'y') { cout<<"Please enter …

Member Avatar for Clinton Portis
0
128
Member Avatar for micke

I have made a simple application to demostrate the problem I got in making a much more complicated one (didn't want to post all of it here). I don't know how to add character values longer than one letter to arrays. [code] #include <iostream> using namespace std; int main() { …

Member Avatar for Clinton Portis
0
196

The End.