49,757 Topics

Member Avatar for
Member Avatar for trantran

I have a C++ standard related question. Let's say I have 2 derived object D1 and D2 (which may contain class D virtual functions) of an identical class base B. Now, I create base pointers bpD1 and bpD2 to those objects. 1) Are bpD1 and bpD2 *guaranteed* to be different …

Member Avatar for trantran
0
185
Member Avatar for king03

Guys I need help. When I am already done inputting the needed information, when it comes to outputting file stream to a notepad it stops and says "program.exe has stopped working. windows is checking for a solution" and there is a loading bar. please help i don't know what I …

Member Avatar for Arbus
0
164
Member Avatar for fatalaccidents

Hey guys, I'm writing a program for a class that basically is a menu that allows you to add people, delete people, change info, locate them by ID and last name, print the list, load the list from a file, and save the list to a file (in that order …

Member Avatar for fatalaccidents
0
248
Member Avatar for king03

Hi there guys I need a little help about separation of two worded strings. Below is a program that will ask a user to input first name, middle name, and last name. Whenever I input a two worded string in the "Enter First Name" part, for example: "Michael Jordan" and …

Member Avatar for Ancient Dragon
0
103
Member Avatar for emmaand

hello I have build a high score list that asks the user to enter name and score and then sort the list so the score comes in the right order. My problem is that the sort function only works once, the second time I enter name and score the list …

Member Avatar for emmaand
0
123
Member Avatar for kevinmax101

Hi, im currently doing a pacman game in c++ as a project. im currently not using graphics but only using the console for simple representation. right now, I'm having problems concerning detection of pellets. Im a bit confused why it detects it as walls even though i check if the …

Member Avatar for TrustyTony
0
1K
Member Avatar for crapgarden

Can someone explain this excerpt from a book I'm studying: [CODE]char phrase[] = "Game Over!!!";[/CODE] [U]BOOK:[/U] [I]"C-style strings terminate with a character called the null character to signify their end. You can write the null character as ’\0’. I didn’t need to use the null character in the previous code …

Member Avatar for crapgarden
0
186
Member Avatar for merse

How to determine the encoding of a text file? And are there any tools to handle the content of a text file independent of its encoding?

Member Avatar for Ancient Dragon
0
117
Member Avatar for Lilcrew

I need to make a SIMPLE BASIC program that plays crabs [code] #include<iostream> #include<string> #include<ctime> using namespace std; int main() { int money, i, wager, roll, roll1, roll2; string name; char bet, R; cout <<"Lets Play Craps!" << endl; cout << endl; cout <<"This program stimulates a session at a …

Member Avatar for NathanOliver
0
300
Member Avatar for M1n1m@l1$t

The following is the code for my program that is supposed to choose a random number and then get the user to guess it by using the basic hints. It seems like it should work but it keeps coming up with the error:'else' without a previous 'if'. it is getting …

Member Avatar for m4ster_r0shi
0
773
Member Avatar for crapgarden

This is just a quick question about when calculations are performed in a line of C++. Say I have the following block: [CODE]int numItems = 0; inventory[numItems++] = "sword"; inventory[numItems++] = "armor"; inventory[numItems++] = "shield";[/CODE] the ++ operator increments the array number of inventory AFTER it reaches the ; operator? …

Member Avatar for crapgarden
0
118
Member Avatar for emmaand

Hello Im am trying to write a high score list . The user is suppose to enter name and score that will be sorted.. like Emma 500 Andy 400 Linda 300 there will be room for five names on the list... I know how to make the program work to …

Member Avatar for emmaand
0
151
Member Avatar for localp

I have a Visual C++ console application (I am using windows Vista, Visual studio 2008). When executing the program i don't want to see the Console popping up. How do i code this. I tried simply removing all cout and printf statements but yet this didn't help. Need help here.

Member Avatar for Ancient Dragon
0
394
Member Avatar for sergent

I don't understand why it is allowed to declare variables in a while or for loops. For example this is allowed (or at least compiles ??) [CODE] for(int i = 3; i > 0; i--) { int d; }[/CODE] and this will give you a compiler error; [CODE] int d; …

Member Avatar for sergent
0
142
Member Avatar for king03

Hi there I need your help about a program because I am not quite sure if there's still a need for me to use streaming in this program here it is: [COLOR="Green"]Create a program that will prompt the user to enter how many students she/he wants to enrol. After the …

Member Avatar for Arbus
0
111
Member Avatar for UltimateKnight

Any function for changing the text color in Microsoft Visual Studio 2008? Thanks.

Member Avatar for UltimateKnight
0
232
Member Avatar for king03

Hi there friends I have an inventory program that stores all the data entered by a user. I am having trouble trying to output the infos entered. I tried to use for loop but no luck. Mine only outputs the last set of keyed in information. It will not output …

Member Avatar for Arbus
0
159
Member Avatar for iamuser_2007

hi i know positive examples for > stack unwinding, > constructors, destructors and exceptions handling, > exceptions and inheritance. tell me some negative examples of these. thnx for guidence

Member Avatar for mitrmkar
0
75
Member Avatar for jackmaverick1

When I execute this code, I get the following error: [ICODE]‘Block’ does not name a type[/ICODE] This is the code: Block.h [CODE] #include "Area.h" #ifndef Block_H #define Block_H #ifndef Cube_H #include "Cube.h" #endif #ifndef nullptr #define nullptr 0 #endif class Block : public Area { int ID; int BlockType; Cube …

Member Avatar for Arbus
0
121
Member Avatar for thecoolman5

hi, i have written this code. [CODE]#include<iostream> #include<windows.h> #include<mmsystem.h> #include<stdlib.h> using namespace std; int main (char argc) { PlaySound("TardisTest1.wav", NULL, SND_FILENAME | SND_ASYNC); system("pause"); return 0; } [/CODE] and for some reason, when the program runs, all it does is system("pause); and it doesnt play the sound. I have my …

Member Avatar for m4ster_r0shi
0
3K
Member Avatar for cppgangster
Member Avatar for cppgangster
0
119
Member Avatar for steve421

Here is a snippet [code=c] myfunc (VARIANT *dmessage){ long len; len=strlen(dmessage); [/code] I get error : cannot convert parameter 1 from 'struct tagVariant' to 'const char *' =============== I want to pass a pointer to a function. I have tried, below, but I got a differ error. [code=c] myfunc (char* …

Member Avatar for Ancient Dragon
0
853
Member Avatar for pseudorandom21

Well guys, I'm having a hard time learning enough about ANNs to apply them to a problem. Firstly my general understanding is that the network adapts during the "training" phase to produce the correct output with the given set of inputs. This is obviously useful with image recognition, or handwriting …

Member Avatar for pseudorandom21
0
189
Member Avatar for Nawar

Hello everyone: OK, so I'm working with a hard head company and hard head boss who want until now to work with DOS, I want to make my programs with a good GUI environment, I tried to work with MGUI it's good but it has its quirks. Then I tried …

Member Avatar for TrustyTony
0
599
Member Avatar for salah_saleh

Hey All, this is my first post on the forum so I want to send my greetings to all of you :) . Actually I am studying biomedical engineering and I am moving to my last year in the school, and I have to search for a graduation project idea, …

Member Avatar for rubberman
0
186
Member Avatar for Lilcrew

I need to create a rectangle using for loop and a nested for loop So far the code I've got is: [code]#include<iostream> using namespace std; int main() { int row, i, width, spaces; cout <<"Enter the number of rows: "; cin >> row; cout <<"Enter the rectangle width: "; cin …

Member Avatar for mrnutty
0
136
Member Avatar for ichigo_cool

Okay I'm damn fed up with this problem ever since I've been trying to organize a bunch of global variables and functions. I'm organizing the variable/function declarations in a header file and defining them in a separate cpp file. So, Globals.h and Globals.cpp.. I then try and link this both …

Member Avatar for mrnutty
0
546
Member Avatar for amirwan

hi,can any one give me a good documentation about the library dos.h functions and registers which explain it in a good way to understand. for example function intr86x(),int86(), and structures REGS and SREGS ...........

Member Avatar for sami qaz
0
531
Member Avatar for dina154

[CODE]// Randam Guessing Game #include <iostream> #define NEWLINE "\n\n\n" #include <cstdlib> // need to use rand() function #include <ctime> using namespace std; /*void Start(); void GetResult(); void HighScore(); int a, b, chance, maxrand; char difficultychoice, menuchoice, diffchoice; void Start() { a = 0; b = 0; chance = 0; maxrand …

Member Avatar for dina154
0
2K
Member Avatar for Ravenn

hi, i put together this code to read a text file line by line, split the resulting string into the 4 values and send these values to four text-boxes. during each cycle of that while loop it's suppose to initialize the backgroundworker_dowork, which will read the values and use them(and …

Member Avatar for Ravenn
0
545

The End.