49,761 Topics
| |
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] = … | |
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 … | |
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, … | |
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 … | |
I d like to have a sample of program written in c++ tht manages student notes transcripts) thanks | |
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}; // … | |
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 | |
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 … | |
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 … | |
HEY.Guyz If u r programming in visual studio c++ .PLz SHARE UR SOURCE CODE HERE.I WILL ALSO SHARE MINE.THANKXX;) | |
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; … | |
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 … | |
HI,can anyone help me by telling how to copy a file from one drive to other say C to D.Thanks in advance............. | |
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 … | |
[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 | |
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, … | |
Is this even possible? Or do I have to make the user download the program before they can use it. | |
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, … | |
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 … | |
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 … | |
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 … | |
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 … | |
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 | |
[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. | |
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 … | |
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? | |
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 … | |
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 … | |
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 … | |
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 … |
The End.