51,593 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
460
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
82
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
105
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
708
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
199
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
112
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
160
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
155
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
115
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
127
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
99
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
101
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
203
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
98
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
118
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
78
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
102
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
204
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
184
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
119
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
180
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
132
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
201
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
885
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
259
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
207
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
195
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
653
Member Avatar for Lukezzz

I have a code that is running like this and calling an event. The event is writing some lines to a textfile. But after each loop, the event is writing one more line each time. It seems that the += is filling the left side up. Is there a way …

Member Avatar for Nick Evan
0
86
Member Avatar for abbz375

Hey everyone, I have multiple timers set up for a dialog (MFC) using SetTimer and OnTimer. This works great when I'm on the dialog but if I move away from the dialog and go back to it, the timers get reset, using the following code: [CODE]ShowWindow(SW_HIDE); test testDialog; testDialog.DoModal();[/CODE] [CODE]CTimersDlg …

0
65
Member Avatar for GEOFFSISCO

Hello all, I am not a coder but I have a code problem you might say. I have found myself in quite a conundrum using the SetSuspendState. I want to be able to wake on event and I do not know how to toggle the SetSuspendState at all. By default …

Member Avatar for GEOFFSISCO
0
86
Member Avatar for abbz375

Hi everyone, I'm new to this forum and it has helped me a lot with the project I am currently working on. Using VS2008 and created an MFC dialog based application. I just started learning C++ and am finding it difficult to solve this problem. What I'm trying to do …

Member Avatar for abbz375
0
2K
Member Avatar for Areej N

hiiiii :) i am new here i hope to get enough help to finish my simple project. i am working on a simple program to show the union and intersection between 2 sets. i program it the intersection is working good but the union is not working!!! i am DIEING …

Member Avatar for Areej N
0
75
Member Avatar for kimzstuf

This was a past assignment (it was last week's assignment), but I couldn't complete it. Could anyone help me finish it? I'm new to the function calls. The professor said I didn't call them from main properly. Although I've already received a grade on this assignment, we now have a …

Member Avatar for kimzstuf
0
92
Member Avatar for vinochick

[CODE]#include <iostream> #include <iomanip> #include <cmath> using namespace std; //function prototype double calcPayment (double, double, int); int main() { //declare variables double carPrice = 0.0; double rebate = 0.0; double creditRate = 0.0; double dealerRate = 0.0; int term = 0; double creditPayment = 0.0; double dealerPayment = 0.0; char …

Member Avatar for zortec
0
114
Member Avatar for Jalwes

Could anyone tell me why, in the following code, getline doesn't allow the user to enter any input? Thanks in advance. [CODE] #include <cstdlib> #include <iostream> #include <vector> #include <string> using namespace std; int main(int argc, char *argv[]) { char answer = 'n'; int selection; vector <string> strings; do { …

Member Avatar for jonsca
0
97
Member Avatar for jdm

I'm helping a friend out with some code and I'm having the hardest time figuring out how to do this. I know it is simple, but for the life of me I can't remember how to do it. Any help or advice would be welcomed. Thanks for the help in …

Member Avatar for jonsca
0
119
Member Avatar for Clinton Portis

A lot of people have questions about how to load a text file using file I/O. There seems to be 2 popular methods to loading a text file: Use fstream's >> extraction operator. Simple enough, load the file directly into individual containers, word at a time, but you lose your …

Member Avatar for mrnutty
1
195
Member Avatar for vinochick

I have the program written but I'm getting a 0 instead of the age I entered. [CODE]#include <iostream> using namespace std;; //function prototype void getAge(int); int main() { //declare variable int age = 0; //call function to get the age getAge(age); //display the age cout << "You are " << …

Member Avatar for Clinton Portis
0
97
Member Avatar for RThomasM

Hey there, so I am new to this forum and to C++ it is my first year in computer science and I am having some problems with this assignment, which is easy enough but I have hit a hitch and would appreciate if someone could point me in the right …

Member Avatar for RThomasM
0
203
Member Avatar for ninreznorgirl2

I'm trying to delete a linked list and Its crashing when i get towards the end of the linked list. [code] void ZapList (NodePtr List) { NodePtr Temp; while(List->Link != NULL) { Temp = List -> Link; //set temp equal to the list pointer List = List -> Link-> Link; …

Member Avatar for mrnutty
0
76
Member Avatar for SamY

I mean we create our own game engine which works well with vectors and can mainpulate the 3d card and sound cards.And works with USB control pads

Member Avatar for Pokeking
0
220
Member Avatar for taylorc8

I have a fairly good understanding of C++'s C side and little bit about classes, so.. I'm wondering, is there an easy way to learn WIN32 application programming? I mean using [code] int APIENTRY WinMain() [/code] window procedures, creating buttons, etc.. Is there a way to avoid things like "String^" …

Member Avatar for Ancient Dragon
0
88
Member Avatar for mtusk

I have a program, call it X, that uses two classes: call them Y and Z. X uses Y which uses Z. Y contains an array of Z's. How do I construct an array of Z's and still allow me to set Z's variables. For example I know how to …

Member Avatar for mtusk
0
119
Member Avatar for DaBunBun

For some reason netbean hates me, as well as eclipse. So i set cygwin as the compiler and debugger and everything, and tried a simple print statement and all i got was: The system cannot find the path specifiedProcess is started in an external terminal ... RUN FAILED Any help …

Member Avatar for DaBunBun
0
131
Member Avatar for Sabaa

Hi, My problem is that in my C++ program (not written yet!) I have to login to a website (like [url]www.example.com[/url]) first. Simply I don't know how to do this! I did not find any useful tutorial or code by searching. I would be so grateful if you can help …

Member Avatar for taylorc8
0
235
Member Avatar for Doughnuts

Hello, I am trying to get the coordinates of the cursor when the user left clicks the mouse. I read that you can use this: [CODE]if (WM_LBUTTONDOWN) { int x = LOWORD( LPARAM ); int y = HIWORD( LPARAM ); }[/CODE] However, when i compile, it gives me this error: …

Member Avatar for Intrade
0
4K
Member Avatar for jonathanYoung

problem; im currently in highschool, and the school uses an older version of visualc++ that does not support strings with all of the functions. the function im talking about is the one when you try to "open" a file to write onto it. what i need to do is find …

Member Avatar for Doughnuts
0
118

The End.