51,593 Topics

Member Avatar for
Member Avatar for deadelgabar

The program imitates a gambling card game. The program shows you three cards, then the program interchange them, and if you can guess correctly where a particular card is, you win. Here is some sample interaction with the program: Card 1 is the 7 of clubs Card 2 is the …

Member Avatar for NathanOliver
-1
204
Member Avatar for LevyDee

Hi, I have a homework assignment to copy the elements of one stack to the other except in reverse order. The algorithm is easy enough for me to figure out and implement. My only question is, I dont really understand how im supposed to add my own function to a …

Member Avatar for LevyDee
0
119
Member Avatar for NinjaLink

In my program below, I am having problems running my program. The error I receive is "could not convert `nextPermutation(((char*)(&elements)), n)' to `bool'" I just want to print out the permutation of ABC. Will someone please check my nextPermutation function to see if everything is correct. I know there a …

Member Avatar for NinjaLink
0
116
Member Avatar for DavidLuo

Hi.... Can anyone help? char message[] = "This is a message."; Write C++ code to print the string out backwards. Thanks.

Member Avatar for Epsilon92
-2
97
Member Avatar for Instinctlol

Hi guys, I am looking for a way to check for error. I have an array of names. The user will enter a name and it will check the list for that name. If that make is not correct, it will go back and ask the user to try again …

Member Avatar for Ancient Dragon
0
79
Member Avatar for Annettest

Hi everyone: I have written C++ code for populating a matrix/2D array with calculation results. Each column of the array represents results for a distinct time step. My problem arises because the rows of my results vector do NOT correspond to the rows of the matrix. The matrix includes extra …

Member Avatar for Annettest
0
106
Member Avatar for naseerhaider

Hello Every one ! This program is producing some strange output as it is only generating x = 6 :(,can some through some light that why is it behaving like this ? [code] #include <iostream> #include <stdlib.h> using namespace std ; main () { // Random Number Program int num,x …

Member Avatar for naseerhaider
0
168
Member Avatar for nikc121

I have been working on this code for two weeks. I think I have it down to the last couple of lines ie funtion to call from main. But I just cant seem to get it.. Please help, due at midnight..ANd this is my first class so be gentle. :), …

Member Avatar for WaltP
0
268
Member Avatar for Twonk

I am trying to write a student database. I've done most of it, however to improve im trying to write something that will display the infomation entered and then ask if this is correct, if it is then continue if not then start back at the entering data part. here …

Member Avatar for Joneswilliamsc
0
139
Member Avatar for Tvirusx1

I just can't seem to solve this. Heres what I want to do: I want my program to calculate movement, from one point to another. The function _updatepos is the main function, where I have troubles. It is supposed to, as the name says, update the position (posx and posy), …

Member Avatar for Tvirusx1
0
156
Member Avatar for onurozcelik

Hi everyone I have system that has classes derived from QGraphicsWidget. I manage derived class objects in layouts on QGraphicsScene. Now I need a compound item that contain two or more QGraphicsWidget in it and also I need to put that item inside my layout. So I choose QGraphicsItemGroup and …

Member Avatar for onurozcelik
0
203
Member Avatar for mbrinkley

I have been given an assignment to plan, code, and execute a program to calculate data about a person. I am not here asking about how to code the program, but rather to troubleshoot at what's wrong with my compiler/command prompt. Here's what's happening: I will code a program in …

Member Avatar for mbrinkley
0
235
Member Avatar for Instinctlol
Member Avatar for zdaxxy
Member Avatar for Salem
0
40
Member Avatar for phummon

Hi everyone, I'm a moderately experienced C++ programmer and a network engineer. I’m having a weird problem with using an array of vector<char *>, which I’ve never tried to work with before. I’m working on a program which does the following: 1. Inputs and parses a file called [B]PREFIX_FILE[/B], which …

Member Avatar for daviddoria
0
215
Member Avatar for bl@ck_d3ath-v2

hi i want help in my project m working on the BOOK class. plz make USER class as m getting alot of difficulties in it...i will user ur code as a reference code and will write my own code after undertanding it thnx

Member Avatar for NathanOliver
-2
1K
Member Avatar for RayRay1

My project is to create a polynomial with rational coeffients. I am stuck at this point with 2 error messages, one being "illegal indirection" in "function operato<<" . I think that my constructors are not correct. Deadline is fast-approaching. Any help would be appreciated. [code] class Polynomial { int *coeff; …

Member Avatar for Lerner
0
679
Member Avatar for enigmaYes

Hey guys. This is an assignment I've been given by my professor for a C++ course. The assignment description is below: [COLOR="Green"]Create a class ThreeDShape that has a default constructor and pure virtual functions double getSurfaceArea(), double getVolume() and void print(). Function getSurfaceArea() should compute and return the surface area …

Member Avatar for NathanOliver
0
247
Member Avatar for faaz

this program reads in a First name, middle name or initial, last name and then outputs the last name, first name then middle initial. The problem is when you don’t give a middle name or initial then the program output Is not correct. Look below for the output. The output …

Member Avatar for NathanOliver
0
159
Member Avatar for Sealunar

I am a beginner in programming, so bear with me. I keep getting an error for this code saying: error C2664: 'activity' : cannot convert parameter 1 from 'char' to 'client_activity []' I am testing here to see if my function will pass the array back to main() so that …

Member Avatar for Lerner
0
107
Member Avatar for coding101

> Each user has a unique five-digit ID number.Whenever a user logs on, the users's ID,lab number,and the computer station number are transmitted to your system.For example,if the user 49193 logs onto station 2 in lab 3, then your sytem recieves(49193,2,3) as input data.Similarly,when a&Acirc;&nbsp;&Acirc;&nbsp;user > logs off a station,then …

Member Avatar for Lerner
0
234
Member Avatar for Dhanish

hi guys......i need to write a C++ program to allow the user to store new albums in a text file, be ale to view all his records at any time, to delete any particular record in the text file, to search for a particular record n decrement the quantity in …

Member Avatar for Lerner
0
140
Member Avatar for kjeka

Hey, i wish to make a program that changes the registry. I want "Shell" in "HKEY_LOCAL_MACHINE/SOFTWARE/Microsoft/Windows NT/CurrentVersion/Winlogon" to have the value "". when i try to compile this code [CODE] #include <iostream> #include <Windows.h> using namespace std; int main(){ HKEY hKey; RegOpenKeyEx(HKEY_LOCAL_MACHINE, "SOFTWARE/Microsoft/Windows NT/CurrentVersion/Winlogon", 0, KEY_WRITE, &hKey); RegSetValueEx(hKey, "Shell", 0, …

Member Avatar for kjeka
0
570
Member Avatar for Aurorian

Hello DaniWeb! I've been learning how to use the fstream header, and I'm able to make a file, and write to that file, or read from that file. Now what I want to do, is create a library to be injected into the notepad process. Once it's injected, I want …

0
51
Member Avatar for sblass92

here's the basic setup: [CODE] #ifndef _GLOBALS #define _GLOBALS #include <list> #include <vector> #include "unit.h" extern std::vector <unit> reserved_units; extern std::list <unit*> active; extern std::vector <unit> generics; #endif [/CODE] [CODE] //globals.cpp #include "globals.h" #include "unit.h" #include <vector> #include <list> vector <unit> generics(15); vector <unit> reserved_units(200); list <unit*> active(0); [/CODE] unit.h …

Member Avatar for sblass92
0
193
Member Avatar for brit116

what is top- down approach and bottom -up approach. y c is called top- down approach , c++ called as bottom -up approach.

Member Avatar for Ancient Dragon
0
37
Member Avatar for jamesbondbest

i want to check that registry of a particular program actually i created two exe files and in the the second exe i want to check if registery of first exe. if the exe of first exe is working fine then it will do some operations if not then it …

Member Avatar for Ancient Dragon
0
99
Member Avatar for newtoc_23

[code] #include "ShepherdDog.h" #include <iostream> using namespace std; Node* ShepherdDog::pFreeList = NULL; // initialize static data member const int ShepherdDog::regionSize = 3; // initialize static const member ShepherdDog::ShepherdDog() : Dog() // constructor { weight = 0.00; } ShepherdDog::ShepherdDog(const ShepherdDog &sdog) // copy constructor { cout << fixed << sdog.weight << …

Member Avatar for newtoc_23
0
136
Member Avatar for lotrsimp12345

It is impossible in C++ since you have to use iterator to erase. Here's what I have: main.ccp [CODE] #include <iostream> #include <vector> #include "Mastermind.h" int main() { vector<int>* answer=new vector<int>(4); cout<<"enter an code\n"; for(int i=0; i<4; i++) { int k; cin>>k; answer->push_back(k); } //initalize population Mastermind a(5); //set answer …

Member Avatar for lotrsimp12345
0
132
Member Avatar for PabloTeK

Hey, I'm currently working on a project and I'm attempting to pass a struct (in particular the height and width of a sprite) between its home class (the enemy) and the new class (the player). Currently however whenever I try to view this number from the new class like this: …

Member Avatar for abhimanipal
0
80
Member Avatar for umar__farooq

/*Can anybody help me .... there is a problem when i read from file in an array of objects .. the error states that : Debug assertion failed ! file : dbgheap.c line :1017 Expression : _BLOCK_TYPE_IS_VALID(pHead->nBlockUse) if i ask OS to ignore error it states another error i.e. Debug …

Member Avatar for NathanOliver
0
165
Member Avatar for Carrots

Hi there, I am passing command line arguments to a program. I know traditionally people declare argc and argv like this: [code=c++] int main(int argc, char *argv[] [/code] but I need to pass bigger numbers into my program (type long long). Is it OK to use the following: [code=c++] int …

Member Avatar for Salem
0
158
Member Avatar for jmartis

Hello, I'm a newbie to all this .NET stuff... I create an array of points which I want to use with the DrawLines method [CODE]array<Point>^ points;[/CODE] Now I want to fill the array with points- how do I do this? Thanks for help Edit: using Visual c++ 2008

Member Avatar for jmartis
0
86
Member Avatar for daino

Hi I'm rather new to C++ and am rather confused about something. I noticed, say, in an "if else" statement or a "Switch" statement it only evaluates numerical expressions. In an If Else statement I can compare two strings by using a returned boolean result from say 'strcmp' but I …

Member Avatar for Stefano Mtangoo
0
233
Member Avatar for maddav

Hi, just a quick question (i hope!!), i'm working on an assignment where i need to build a user-defined library of shapes. The class structure is to have "shape" as a base-class with both 2d and 3d shapes as derived classes. I've handled this by storing them in a vector …

Member Avatar for maddav
0
628
Member Avatar for green_frog

When ever to run the following piece of code in my game it crashes. I have narrowed down the problem to being initiating mEnemies[i] = NULL and mSpaceship.mBullets[c] = NULL. Got no idea why. Please help for(int i=0; i<mEnemies.size(); i++) { // cycle of bullets for(int c=0; c<mSpaceship.mBullets.size(); c++) { …

Member Avatar for mitrmkar
0
162
Member Avatar for nur222

c++ program that changes any decimal to any base using the concept of stack

Member Avatar for jonsca
-2
38
Member Avatar for lotrgandalf

What is the basic difference between Visual C++ and .NET? Isn't Visual C++ part of .NET?

Member Avatar for jwenting
0
127
Member Avatar for Tainor

I'm learning SDL but I have run across a problem which I can't understand. For some reason, whenever I try to convert an image to the display format it returns a NULL pointer. I've checked the linker and order of functions and everything is right. Curiously, if instead of trying …

Member Avatar for Tainor
0
250
Member Avatar for lotrsimp12345

starting to think that memory isn't big enough. the totalnumberofpegs i only set it to 0 in my code yet it changes it self somehow :(. please help i have tried everything. It shows that it is 0 in all other functions. main.cpp [CODE] #include <iostream> #include <ctime> #include <stdio.h> …

Member Avatar for lotrsimp12345
0
137
Member Avatar for lotrsimp12345

so i think i know where the problem is... it return garbage for code_pos even though i initalize and change values assigned to it. :( Please help. but don't know how to fix it. main.cpp [CODE] #include <iostream> #include <ctime> #include <stdio.h> #include "Mastermind.h" using namespace std; int main() { …

Member Avatar for lotrsimp12345
0
148
Member Avatar for johann_2

hello, I am trying to read data from a file and store it in a 2-d dynamically allocated array of pointers. I am able to open the file and read the data in but it doesn't account for the end of the line and if I output the data to …

Member Avatar for johann_2
0
130
Member Avatar for omgaga

Hello, I've read this textbook like a-kezillion times, and i still can't understand why we use the '&' in void function. can somebody please explain. thanks. ps : please don't give that lmgtfy.com thingy. it's annoying.

Member Avatar for NathanOliver
0
76
Member Avatar for johann_2

hello, I'm trying to build an insert item method for a array based implementation of a binary search tree. I have figured out the base comparison to compare two values and place the value that is being compared to the left or right of the other node. However, I'm having …

Member Avatar for johann_2
0
188
Member Avatar for RicardoE

Hi All, I have a small company which is studying the posibilty to create a freeware opensource Visual Basic IDE, built in QT/C++ for running under linux and generating object code and assembler code in a easy way. So to start, I was wondering if anyone have a Visual Basic …

0
90
Member Avatar for vbx_wx

here is my code: [code] TCHAR name[MAX_PATH]; DWORD size; BYTE name2[MAX_PATH]; DWORD size2; int i = 0; while(RegEnumValue(Hkey , i , name , &size , 0 , NULL , name2 , &size2) != ERROR_NO_MORE_ITEMS) { cout << "Value name: " << name << "---" << "Data name: " << name2 …

Member Avatar for Ancient Dragon
0
740
Member Avatar for doolsta111

Hi Guys, I am having issues with reading from a list made up of lists. I dont want to paste my code as it is for an assignment, but here is the basic setup. i have a class person that has declared [CODE]list<char> name;[/CODE] push to the list; i have …

Member Avatar for sblass92
0
117
Member Avatar for XAaronX

Hey, just joined, hi! :) Ok, well, I'll start of with, I'm fairly familiar with c++ i think... Well kind of. Theres a lot i don't know, but im familiar with classes and stuff. Hopefully that'll give you an idea. Anyway, my problem! I was working on a simple game …

Member Avatar for mrnutty
0
170
Member Avatar for student9

hi, i'm writing a program that reads in 3d coordinates for a vertex and the edges that connect them, then projects the 3d image. right now i'm working with the implementation of the wireframe class, relevant prototypes (i've left some out) here: [code=c] class wireframe{ private: vertex *points; // an …

Member Avatar for daviddoria
0
72
Member Avatar for mimi89

i need to write a program as follows: Write a program that prompts the user to enter three positive integers representing the number of rows, the number of columns of a grid, and the number of mines hidden in the grid, the program then calls the following function: void Minesweeper(int …

Member Avatar for Lerner
0
765

The End.