49,756 Topics

Member Avatar for
Member Avatar for mybluehair

I have a program in were you enter numbers. each different # set you enter goes into an array ( section[] ) but now what I'm trying to do is add 2 different sections together. [code]for(int x = 0; x < stoppoint; ++x) { track = track + 1; if(section[x] …

Member Avatar for Freaky_Chris
0
108
Member Avatar for robgeek

Hi everyone, I have worked some more on my code and this time I am getting some error that I am not able to resolve. Please help me. The error says: "initialization skipped by case label." Please show me how to resolve this. Here is the code. The error has …

Member Avatar for robgeek
0
4K
Member Avatar for n8thatsme

Ok, I never really understood vectors and I have write a program that uses a vector of Employee references to store the company’s payroll. My program will load the payroll by reading a file (employee.dat) that contains one employee’s information per line. Each line of the file will begin with …

Member Avatar for ArkM
0
369
Member Avatar for Taker

I hsve developed this code I am having trouble with the Account manager to perform the task it meant to do when i put N for New customer it exits the program and i shouldnt can anyone hepl me with this problem [code] #include <iostream> #include <string> #include <cmath> #include …

Member Avatar for WaltP
0
205
Member Avatar for avpy

hi people, i am able to make the following code work if i don't use a destructor: #include<iostream> using namespace std; class CVector{ public: int *x, *y; CVector(); CVector operator+ (CVector); CVector(int,int); // ~CVector(); private: }; CVector::CVector(){ x = new int; y = new int; *x=0; *y=0; } CVector::CVector(int a, …

Member Avatar for vmanes
0
120
Member Avatar for chunalt787

Some of the code has been omitted. I am trying to write a DFS function to traverse a maze. It will eventualy add the nodes to a tree that I will traverse once I get the DFS working. Currently it goes into an infinite loop and I cannot figure out …

Member Avatar for chunalt787
0
582
Member Avatar for midimatt

Hey again guys and gals, getting a really weird error when i attempt to print out doubles in my program i have to store several double values, but when ever i print then out all i get is -9.25596e+061 instead of what should be printed out. [code=C++] string line; stringstream …

Member Avatar for midimatt
0
97
Member Avatar for Momar

I'm still fairly new to C++ and templates and I had a question revolving them. I'm currently doing a tutorial on templates and wanted to mess around with the code. This is what I have so far: [code=c++] //mypair.h template <class T> class mypair { T values [2]; public: mypair …

Member Avatar for ArkM
0
84
Member Avatar for rmlopes

Hello, I implemented the follolwing function: [code] template< int n > struct GetNRands{ static void fillVector( set<int>& v, int max ){ if( n > 0 ){ int f; int pos; do{ f = rand(); pos = f * max / RAND_MAX; } while( v.find( f ) != v.end()); v.insert( pos …

Member Avatar for ArkM
0
134
Member Avatar for Icebone1000

win2000 , visual studio 2005, console application (sorry my poor english) I dont know very well how start explain whats my problem.. Im making a sudoku game (not unic solution, just random =P) the problem is the loop where it suppose to verify the sudoku rules and make the corrections …

Member Avatar for Murtan
0
209
Member Avatar for g_loughnan

Hi All, I'm trying to figure out how to pass an object to a function by constant reference. If I write a single class, can I write a function in this class that accepts an object of this class by constant reference? If so (or in any case) how does …

Member Avatar for StuXYZ
0
610
Member Avatar for koushal.vv

Hi , I am working with MFC SDI application, when i open any project [ SDI ] default icon gets loaded [ ie MFC icon ] , i am not able to change it , even i tried modifying the icon file, only the ABOUTDialog box icon changes, at all …

Member Avatar for mitrmkar
0
195
Member Avatar for 666kennedy

i have an array of 16 things, now 8 of them have to be chosen at random so basically what i want to do is random(CHR/2) like choose a random number from CHR/2 (as there are 8 not 16 now) what code would i use because that doestn work

Member Avatar for Freaky_Chris
0
122
Member Avatar for Lotus_2011

[COLOR="Red"][B]Hi all... I tried to maked Stack with Dynamic Array but ........[/B][/COLOR] [ICODE]class Stack { private: int *SS; int size; int t; void Expand(); public: //constractors Stack(); ~Stack(); Stack(const Stack & Original); //operations Stack &operator= (const Stack& RHS); bool Empty(); void Display(); int Pop(); void Push(int Value); int Top (); …

Member Avatar for StuXYZ
0
1K
Member Avatar for Umar Ali

Hello guys! Hope everyone's doing good. Well I desperately need the code for insertion in 2-3 trees, can anyone of you kindly help me out??? Actually I missed one of the lectures given in this regard, therefore i'm facing few daft problems, I tried to some extent but couldn't make …

Member Avatar for Murtan
0
171
Member Avatar for wanghong.li

Dear All, I have to remove some content of a file, but I can't find any api to use. Best regards!

Member Avatar for MosaicFuneral
0
46
Member Avatar for PhoenixInsilico

Why does following does not work ?? [CODE] #include<iostream> using namespace std; class point{ float x,y,z; public: point(float f_x =1.0, float f_y=1.0, float f_z=1.0); void getxyz(float &x, float &y, float &z); }; point::point(float f_x, float f_y, float f_z) { x= f_x; y= f_y; z= f_z; } void point::getxyz(float &x, float …

Member Avatar for PhoenixInsilico
0
782
Member Avatar for pavel989

well the title kinda describes it. I tried LOWORD(lParam) = somenum; and it threw me an error saying that the left side valye has to be a 1-value

Member Avatar for Murtan
0
114
Member Avatar for mridulsouth

I have problem in counting the number of letters in the strings entered by the user. CAn anyone suggest something in the following codes? [code=cplusplus] #include <iostream> using namespace std; int main() { char* str; cout<<"enter the string to count the number of letters in it."; cin>>str; cout<<str.length; return 0; …

Member Avatar for MosaicFuneral
0
115
Member Avatar for Jason123

How can i get the digits out from file and the player who scored the most points? Input file to read from Match A score: 3-1 [U]Mark Peter Peter[/U] Match B score: 1-1 [U]Jim[/U] underlined - player who scored the points [code=cpp] #include <iostream> #include <fstream> #include <string> using namespace …

Member Avatar for Jason123
0
202
Member Avatar for MJFiggs

I dont know why, but this program I wrote is having a problem. it has a problem converting an Ace from 11 to 1 when the players have more than 21. if you could look over this, I would appreciate it. [code] #include <iostream> #include <ctime> using namespace std; double …

Member Avatar for MJFiggs
0
115
Member Avatar for Lukezzz

I am stuck in a problem where I should show a progress in % in a label. I have manage this code and think this should work but the label doesn´t update the % value it only shows "Progress... 0 %". Is there anything I perheps should add to update …

Member Avatar for Lukezzz
0
84
Member Avatar for daviddoria

With printf, you specify the output type like this unsigned char a; printf("%u", a); but with cout, cout << a; there is no type required. Do you have to cast the variable in order to see a reasonable output cout << (int)a; or something like that? How do you know …

Member Avatar for StuXYZ
0
99
Member Avatar for JackDurden

Does anyone know how to search a text file for just alphanumeric words using regex? And could you show me?

Member Avatar for StuXYZ
0
102
Member Avatar for Ameerah

hi, please helpe me my code include one problem and i dont know how to slovet the heder [ICODE]#ifndef COURSE_H_ #define COURSE_H_ #include <iostream> using namespace std; #include<string> using namespace std; class Course { private: string id; int NumberOfCredits; static string serialId; public: Course(string corsename) { } void print() { …

Member Avatar for Lerner
0
137
Member Avatar for noexit

Hello, this is my first post so be nice :) After hours of trolling various forums and websites along with a few books i've decided to ask for help. I've put together the whole of the program which is to carry out a few simple processes using inputted data and …

Member Avatar for Lerner
0
113
Member Avatar for cout<<"alias"

Hi there, been working on a small program that will loop a function which adds two integers until the user enters 00, but can't seem to work out the finer details. A little newer to C++, don't need a complete answer but any advice would be much appreciated [code=c++] #include<iostream> …

Member Avatar for cout<<"alias"
0
384
Member Avatar for anupamsps

hi friends; i am trying to build a class using multimap, the idea is something like this: I have say N no of particles and each particle has fix position in 3d space something like this: Coordinate: Particle level (1,2,3) ----------------> 1 (1,2,3) ----------------> 7 (1,0,0) ----------------> 2 (0,0,0) ----------------> …

Member Avatar for StuXYZ
0
176
Member Avatar for joeblob17

I am importing object files and making tables from the for a project due tommorow night. The function works fine when I use it the first time i.e. input pro1.txt, but when I call the function again and input pro2.txt as the file name my program crashes. All of the …

Member Avatar for joeblob17
0
82
Member Avatar for cog_bn

When I run the code, what's supposed to happen is that when I input three numbers separated by spaces (e.g. "[i][u]23 4 5 <enter>[/u][/i]"), it outputs "[b]no more input\n\nReady\n[/b]", when I input four or more numbers (e.g. "[i][u]23 4 5 34 65 <enter>[/u][/i]"), it outputs "[b]is more input\n\nReady\n[/b]": [code] #include …

Member Avatar for cog_bn
0
180

The End.