49,761 Topics

Member Avatar for
Member Avatar for bobsta

Hi I have just started using STL vectors and iterators so please excuse my ignorance. Suppose I have three classes A,B and C such that : std::vector<A> aObjects wherein each object "a" comprises a vector of "b" objects which in turn comprises a vector of "c" objects ie. [CODE]class A{ …

Member Avatar for Banfa
0
284
Member Avatar for shereefatef

Hello everyone i'am tring to write a program that convert expression from infix to postfix using stack. but i have a problem with my code it terminate the program i can't determine what is wrong but it seems to be in the (precedence) function . so can anyone help me …

Member Avatar for iamthwee
0
156
Member Avatar for manishwadhwa22

hi i was wondering if anyone could show me how to put graphics to the following card game as i want to learn how to add graphics and what type i should use like for example: DRAC or is there something even better, cheers: [CODE]#include<cstdlib> #include <process.h> #include<ctime> #include <iostream> …

Member Avatar for Ketsuekiame
0
149
Member Avatar for godflesh231

when i run my code i get one, and i can't tell which part of my code is faulty as VC++ points me to this code from <xlocale> [code=c++] _CRTIMP2_PURE facet *__CLR_OR_THIS_CALL _Decref() { // safely decrement the reference count, return this when dead _BEGIN_LOCK(_LOCK_LOCALE) if (0 < _Refs && …

Member Avatar for mitrmkar
0
159
Member Avatar for sleepybug

hi.i m trying to this program for QuickSort but unable to detect what's wrong in it..probably the prblem is in Divison.. so here's the code:icon_eek:: [CODE] # include <iostream> using namespace std; # define N 20 int Divide(int a[],int left,int right) { if (right < 1) return 0; int i=a[left], …

Member Avatar for abbasshahrokhi
0
108
Member Avatar for tinanewtonart

In this program we are going to simulate a simple card game. The rules are that the player selects a card out of a deck of 52 cards. The computer picks a random card out of the deck. The person with the highest card face number wins. In this program …

Member Avatar for kvprajapati
0
6K
Member Avatar for darkangelNeo

[CODE]#include<fstream.h> #include<conio.h> void main() { int iSize,iChoice,iDelete,iMem={1024}; clrscr(); cout << "Brand New Flash Drive\n"; cout << "Message: Free Space: " << iMem << ""; getch(); clrscr(); while(iChoice!=8) { cout << "\n"; cout << "[1] Format Flash Drive\n"; cout << "[2] Copy File\n"; cout << "[3] Delete File\n"; cout << "[4] …

Member Avatar for Ketsuekiame
0
312
Member Avatar for coding101

hi, I dont know how to use bubble sort or heap or whatever else there is. what im trying to do is sort a list of number and delete the repeats. So the user types in how many numbers they want to enter, and then types in the numbers. ex. …

Member Avatar for WaltP
0
153
Member Avatar for bobbyg118

I am new to this website and was looking for some help .I am currently having trouble because I need to take the function generateOutput and have it display three random messages: Excellent, Good Job, and Very Good. Attached is the .cpp file

Member Avatar for Ali Shah Ahmed
0
98
Member Avatar for mebob

Hi, I recently downloaded the GMP library, and I am completely lost in building it. I tried building it, but it just doesn't want to work for me. I want to build the C++ wrapper. BTW, I have never built a library before, so please excuse any of my stupidity …

Member Avatar for mebob
0
88
Member Avatar for kratosaurion

Hi guys, when I was working on this game for school I ran into a weird linker error, LNK2019. It bugs me to no avail, so hopefully you guys can help me. It seems to be a problem with the string pas. I submitted alternate values for where they would …

Member Avatar for LevyDee
0
148
Member Avatar for LevyDee

I'm working on a chat server/client program. So far Ive gotten to where I am by using examples and using msdn. So my problem now is getting my client to properly connect to my server. When I run my server and locally connect through telnet on my computer, it runs …

0
49
Member Avatar for nu2cpp

Hi Guys, I am running vc in visual studio 2009. I have a code that I wrote to read a binary file a while back using c++ (all in a console). Now I am trting to update the code using a GUI. In the console version the file location was …

Member Avatar for Narue
0
96
Member Avatar for corby

hey guys/gals. how do i save to a file the data that is printed by this program i wrote. I have the code to do this in the createFile function but i am unsure in how to output what was printed. Any suggestions? [CODE]//class member functions #include "experiment.h" Experiment::Experiment() { …

Member Avatar for hnizamoglu
0
139
Member Avatar for fougere

Hello. I am writing a program with some dynamic arrays of pointers to objects (not arrays of objects). Since there will be A LOT of tacking on new objects to the arrays, for the purposes of efficiency, I am implementing an algorithm to fill up a buffer array first and …

Member Avatar for fougere
0
149
Member Avatar for abhimanipal

Hello Everybody, I have a small doubt regarding how we can call constructors in a C++ class [CODE]class test { public: test() { cout<<"In test\n"; } }; int main() { test t1; test t2(); // This call does not give compile time error but does not call the constructor cin.get(); …

Member Avatar for abhimanipal
0
101
Member Avatar for numbawang

hi there, im a student in gr11 currenting taking computer science. I have a summative due 2-3 days from now and need help with explantion on one part of my program that im missing. So far I've learned, functions,loops, and some understanding of arrays. The project is to write a …

Member Avatar for daviddoria
-1
122
Member Avatar for vivosmith

Hi I found this example on about.com . I understand most of this, but one part is giving me problems in genral. I tried classes before, and it did not go over so well. But since this is someone else code, it might be better than mine :). Thanks [CODE] …

Member Avatar for Fbody
0
101
Member Avatar for Piyush07
Member Avatar for Fbody
-1
39
Member Avatar for mcheng

Hi, i'm new to C++ and i understand someone else has asked this question on this forum before. I read the replies but still don't know how to resolve my error. gcc version is 4.2.2. The linker error i encountered is build_products/shared/x86/sgos_native/debug/gcc_v4.4.2/ced.o: In function `CEA_Disk_lister::CEA_Disk_lister(CEA_Disk*)': ced.cpp:(.text._ZN15CEA_Disk_listerC1EP8CEA_Disk[_ZN15CEA_Disk_listerC1EP8CEA_Disk]+0x25): undefined reference to `vtable …

Member Avatar for Narue
0
1K
Member Avatar for c++lover

i'm new here and i have a question regarding pointers that is here You are required to write a program that takes a phone number as input from the user and stores it as a string value. The phone number will consist of country code, city code and actual 7-digit …

Member Avatar for daviddoria
0
127
Member Avatar for j.kelly

I am new to C++ and cant get my program to compile because of #include recursion. I have 3 classes A, B, C. A includes B.h and C.h B includes A.h C includes A.h and B.h They include each other because they either need to send messages between themselves. No …

Member Avatar for faaano
0
2K
Member Avatar for spartan118

Hope your ready :P [CODE] /* THIS PROGRAM IS INCOMPLETE!! PLEASE DON'T CORRECT THE EMPTY FUNCTIONS!! Thanks, Spartan118*/ #include <iostream> #include <string> #include <windows.h> #include "H:\profile\desktop\rawrr\lvp\random.h" #include "H:\profile\desktop\rawrr\lvp\conio.h" #include <fstream> using namespace std; void combat() { randomize(); string object; cout << "Entering combat." << endl; cout << "You are behind …

Member Avatar for abhimanipal
0
100
Member Avatar for kourt32

im trying to use stacks to output files with names here is what i have so far ive tried every combination of file.open i could think of any suggestions? [CODE] #include <iostream> #include <string> #include <fstream> #include <stack> using namespace std; int main(){ stack<string> filename; string fname; int count; ofstream …

Member Avatar for mitrmkar
0
102
Member Avatar for Cowbox

Hai, I've been fiddling around with char, char* and string and thoroughly confusing myself as to what the actual differences are but all in all, I couldn't seem to figure out a way to edit a string/char/char* to do something like this automatically: [I]"File1.txt" "File2.txt" "File3.txt" etc.[/I] None of the …

Member Avatar for Cowbox
0
107
Member Avatar for sandhya.chethu
Member Avatar for anuragcoder

As the title suggests Any help for keypress action folks?? Do we have a keypress func in c++. I'm runnin Win Xp Dev c++

Member Avatar for daviddoria
0
113
Member Avatar for anuragcoder

Can anyone of you suggest, how to create syntax highlighting functionality I would like a code snippet. Please, Anurag

Member Avatar for anuragcoder
-2
83
Member Avatar for anuragcoder

This is my code to create a new file below. The main problem is that the program does not halt for entering file name and also the program creates a file .txt and doesn't save anything in it. Please Help [CODE]int newfile() { system("cls"); cout <<"\t\t-------------------------------------" <<endl; cout <<"\t\t| NEW …

Member Avatar for daviddoria
0
104
Member Avatar for ziwacha

hi may u pliz assist,im a learner of C++,I want to write a code which welcomes you into a bar,asks your age,if u are more than 50yrs it gives it gives one free beer,it prompts you to press some orders and it will calculate the total due amount

Member Avatar for joker400
-4
59

The End.