49,761 Topics

Member Avatar for
Member Avatar for suho

I have a map of pointers to objects, i want to delete some randomly chosen pointers and the objects they point to. Is it possible to do it without using libraries like boost ? I assign the map as follows [CODE]map<int,particle*> particle_map; particle* particles= new particle[number_of_particles]; for(i==0;i<number_of_particles;i++) { particle_map[i] = …

Member Avatar for suho
0
114
Member Avatar for luliana

hi ..pleas any one can help me to write aprogram that allows the user to enter the last names of 5 candidates in a local election and the number of votes received by each candidate, the program should then out put each candidates name the number of vote percentage of …

Member Avatar for luliana
0
80
Member Avatar for kenetpascua

I want to create a menu like this Menu List Type - 1 for Bubble Sort 2 for Insertion Sort 3 Selection Sort 4 Stack 5 Queues heres the code of bubble sort [CODE]#include <iostream.h> #include <stdlib.h> const int MAXSIZE = 10; void bubbleSort(int arr[], int size); void swap(int& x, …

Member Avatar for kenetpascua
0
101
Member Avatar for SgtMe

Hi all. I'm using the following tutorials: [url]http://lighthouse3d.com/opengl/glut/[/url] (for GLUT) [url]http://www.3dcodingtutorial.com/[/url] (for GLM (3D models)) I'm using OpenGL with GLUT and GLM to make a 3D game. Seeing as I was a complete noob, my friend challenged me to make a game 'where you can shoot stuff'. Anyhoo, all was …

0
53
Member Avatar for NHONORE

I d like to have a sample of program written in c++ tht manages student notes transcripts) thanks

Member Avatar for Ancient Dragon
0
56
Member Avatar for tfmontague

I have a class function - which I am trying to pass array values - however the function returns the values even when I don't use the reference &. WHY? COULD SOMEONE EXPLAIN THIS? [CODE] Block example; // create an instance of the class 'Block' int Array1[3] = {0,0,0}; // …

Member Avatar for alvinwong
0
84
Member Avatar for creative_m

how to write a c++ code to solve this problemes 1- make program using recourison to make a tringle (the first line has one star the second has 3 stars and the line number n has (2n-1)stars

Member Avatar for alvinwong
0
86
Member Avatar for tinkeydo

The first part inside the "If" statement works perfectly. The only part I am having trouble with is the "else" statement. I was trying to get it to generate an "x" amount of passwords and get those passwords to be at a length defined by the user. The problem is …

Member Avatar for alvinwong
0
90
Member Avatar for bijayswain

I want to put this code into separate window so that the results are displayed in a custom window not in a command prompt [CODE]#include <iostream> #include <string> using namespace std; void main() { system("title Find Mac From IP"); system("cls && Color DF"); cout<<"--------------------------------------------------------------------------------\n"; cout<<" This Utility is designed to …

Member Avatar for alvinwong
0
107
Member Avatar for mindfreaks2000

HEY.Guyz If u r programming in visual studio c++ .PLz SHARE UR SOURCE CODE HERE.I WILL ALSO SHARE MINE.THANKXX;)

Member Avatar for cwarn23
-7
169
Member Avatar for Instinctlol

Can anyone tell me why it loops my menu() twice after i enter the numbers from Add(). I know it has to do something with cin.ignore() but I don't know where to place it so it doesn't loop my Menu() after. [CODE]#include <iostream> #include <string> #include <fstream> using namespace std; …

Member Avatar for farooq007
0
115
Member Avatar for cwarn23

I have been searching on the web but can't find an answer to this question. How do I make a simple script that will read the functions in a php.net dll file where it can be used in c++. The main reason why I am trying to do this is …

Member Avatar for cwarn23
0
154
Member Avatar for marirs07

HI,can anyone help me by telling how to copy a file from one drive to other say C to D.Thanks in advance.............

Member Avatar for sfuo
0
65
Member Avatar for laelzio.mosca

Please help! [CODE]// Laelzio Mosca // 12/09/09 // Tic Tac Toe game #include <iostream> using std::cout; using std::cin; using std::endl; #include <iomanip> using std::setw; #include <string> using std::string; #include <cstdlib> using std::rand; using std::srand; #include <ctime> using std::time; //global variables const int row = 3; //size of array const int …

0
70
Member Avatar for Thumb2

[code=C++] #include <fstream> using namespace std; void a(ifstream b){} void main() { ifstream b("c.txt"); a(b); // error caused when function a() is used } [/code] Why is this producing an error? Thank you, Thumb2

Member Avatar for jonsca
0
143
Member Avatar for gretty

Hello I have a static window control & I want to make the text inside that static window centre aligned. [B]Is is possible to do that with a static window?[/B] Or should I use another function? static window: [CODE] stBox = CreateWindowEx( 0, "Static", s.c_str(), WS_BORDER | WS_CHILD | WS_VISIBLE, …

Member Avatar for William Hemsworth
1
226
Member Avatar for restrictment

Is this even possible? Or do I have to make the user download the program before they can use it.

Member Avatar for jonsca
0
120
Member Avatar for evilsweeps

Hi, this is my first post on here so forgive me if my question or code is unclear. I'm coding a binary search tree and I'm stuck on the overloaded ==operator. [CODE] //BSTCLASS.CPP template <class ItemType> void BstClass<ItemType>::rFindNode(node<ItemType>* trav,ItemType& item,node<ItemType>* rtTrav, ItemType& rtItem, bool& equal)const { rFindNode(trav->left, trav->left->data, rtTrav->left, rtTrav->left->data, …

Member Avatar for evilsweeps
0
267
Member Avatar for Hathake

Hi there everyone! I am doing calculator that analysses a math term in a postfix notation. My code seems nice, but I suspect it doesnt calculate at all ! It only writes back imput .. Maybe theres error in string/char conversion for all that I know. But please have a …

Member Avatar for Lerner
0
79
Member Avatar for qwertymk

I know I'm supposed to use new and delete, but I really need to use realloc, and I'm curious to how it can be done. [code] myclass { ... public: myclass() { cout << "Hi, I'm the constuctor" << endl; }; int main() { myclass *m; m = (myclass*) malloc …

Member Avatar for Narue
0
144
Member Avatar for laNeek

Greetings! I've been messing around with a bit of code for a while now and I've got it compiling etc etc. The only problem is with perfecting the quicksort function (probably trivial, but then I'm not very skilled). From the output file, it seems to 'sort of' sort the string …

Member Avatar for laNeek
0
101
Member Avatar for HITMANOF44th

hello out there i have a program i made to scan barcodes and reformat the data it gets from com2 now when the thing scanns theres a function called to a class but if there is no new data present it just sit's there waiting for new data ? and …

Member Avatar for HITMANOF44th
0
100
Member Avatar for bijayswain

How to use reg add function in c or c++ program I am using system("reg add .........."); but this gives me a error " program too big to fit in memory" what could be the problem. please suggest

Member Avatar for Ancient Dragon
0
1K
Member Avatar for Agni

[code=c++] class A: public B { C* p1; C* p2; } [/code] What would be a correct assignment operator for class A? We have to ensure that we do not leave any object in an inconsistent state due to any exceptions or create any dangling references or memory leaks.

Member Avatar for Dave Sinkula
0
151
Member Avatar for new programer

hello all I needed to cut a string at a certain point and swap the position of the pieces so I did the following functions [it does not work well] : [CODE]void findcutswitch(string unlock_w, char ring[][26]) { for(int i=0; i<3; i++) { for(int j=0; j<26; j++) { if(ring[i][j]==unlock_w[i]) { int …

Member Avatar for Excizted
0
138
Member Avatar for Instinctlol

can anyone explain to me what return does? I know that return(0) stops the program at any given point, but what does returning others do?

Member Avatar for Narue
0
113
Member Avatar for nschessnerd

Hey, I use openfiledialog to load a file as so: [code=cplusplus] OpenFileDialog^ ofd=gcnew OpenFileDialog; ofd->Filter="Monitor files (*.hmc)|*.hmc"; ofd->FileName="";if(ofd->ShowDialog()==System::Windows::Forms::DialogResult::OK){ loadFile(ofd->FileName); } [/code] when i initially run the program memory in task manager is about 10,000K. when this code runs it jumps to 17,000K and doesnt go back down. I tried using …

Member Avatar for Narue
0
134
Member Avatar for fadia

Question1: Modify your assignment-3, add separator mutator for each field and validate its value in mutators. The setTime validates time by using individual mutators of fields. Add no-argument constructor and three argument constructor. There argument constructor validates fields by using individual mutator of each field. Write new application to use …

Member Avatar for fadia
0
95
Member Avatar for ankiwalia

i have to generate filenames text file names as c:\\blabla.. saved(counter).txt the counter is an integer value i cant do it i cant generate filename like dat i declared a string c:\\blabla second counter third .txt now i have to concatenate all three in a string variable and this has …

Member Avatar for mrnutty
0
88
Member Avatar for jerry_08

guyz i need help.im begner in c++.then problem gave my prof 2me is.GET THE LCD(less common denomnator) input by the user.then i sucesfly made it.she gave us another prob again.REDUCE THE LCD U GOT..and i dont know what is the statemnt i will input.WAITING FOR REPLY THANKS.. need help...i don't …

Member Avatar for zortec
-3
88

The End.