49,761 Topics

Member Avatar for
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
674
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
242
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
154
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
232
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
550
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
49
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
192
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
35
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
97
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
133
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
128
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
78
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
157
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
154
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
83
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
230
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
620
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
159
Member Avatar for nur222

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

Member Avatar for jonsca
-2
37
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
123
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
244
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
134
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
146
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
129
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
73
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
187
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
89
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
725

The End.