49,757 Topics

Member Avatar for
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
670
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
92
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
201
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
115
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
Member Avatar for fliggygeek

I have a system that needs a 7 bit character string converted to an 8 bit string of binary ones and zeroes, in this fasion: [URL="http://www.dreamfabric.com/sms/hello.html"]Encoding sample[/URL] My main task is to find a way of generating a boolean array of each character and its corresponding 7 bits in order …

Member Avatar for Clinton Portis
0
871
Member Avatar for n3r3d

Hello, i have one question for reading from file. I get data from file ulaz.txt and i want to data in there would be stored like [CODE]some text;1934 text 2;2342[/CODE] for now its stored like [CODE]sometext 1934 text2 2342[/CODE] so i want to be able to use space between text …

Member Avatar for pecet
0
258
Member Avatar for Stefano Mtangoo

Hi All, I'm trying to make commandline mp3 player using [URL="http://www.inet.hr/~zcindori/libwmp3/index.html"]libwmp3[/URL]. I use codeblocks and have tried alot and I get error below. I have tried to include libwmp3.h, add libwmp3.a try changing compiler; but no success :( Please help me to get through. I use the code for mp3 …

Member Avatar for Stefano Mtangoo
0
163
Member Avatar for Mariam786

[B]Problem Statement: File Handling in C/C++[/B] On the basis of the given scenario create a file Expenses.txt, Open the file and copy into another Expenses2.txt, Also show output on screen A college has announced the total budget of 50,000Rs.for each game. Games are done four times in a year. Take …

Member Avatar for Clinton Portis
-1
191
Member Avatar for kfg20

I am new to C++ and I need some help getting this code started for this problem. I am asked to do this : Write a function template version of linearSearch, that can be used to search an array of elements of any type. Write the function prototype , the …

Member Avatar for Narue
0
646

The End.