49,761 Topics
| |
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{ … | |
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 … | |
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> … | |
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 && … | |
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], … | |
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 … | |
[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] … | |
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. … | |
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 | |
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 … | |
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 … | |
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 … | |
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 … | |
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() { … | |
| 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 … |
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(); … | |
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 … | |
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] … | |
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 … | |
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 … | |
| 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 … |
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 … | |
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 … | |
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 … | |
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++ | |
Can anyone of you suggest, how to create syntax highlighting functionality I would like a code snippet. Please, Anurag | |
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 … | |
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 |
The End.