49,757 Topics
| |
Hi! What could be the best algorithm for "Merge Sort" where the memory must be used "most effectively"? I just know the standard way to do this, but that's not the most effective way how to use the memory. This is the only variant which I know: [CODE=c] #include <iostream> … | |
I sometimes see people code like std::cin and stuff and say that it's bad to use "using namespace std;" Why?..... | |
Hey guys, I've been having a bit of trouble with my c++ program i'm trying to create for an assignment. I'm still learning, but array's seem to give me the most trouble. I've been reading and searching google alot to try and find examples to help my situation, but i'm … | |
i know how to find prime numbers of several numbers, does anyone know hoew to find a prime sumber of a single number inputed by the ser using the following function and printing out if the number is prime int mai()//asks for input { int num; cout << "enter number:"; … | |
Could someone help me, please: How can I convert a cstring (Input math expression) into an array of integers and characters(*, +, etc.)? I know atoi function would return 0, if there are other characters, not digits. Is there a function to do it? I appreciate any help. Thank you. | |
I have put together a program using a class AbstractSort that can be used to analyze the number of comparisons performed by a sorting algorithm. Anyway, I built the programs( I have 2 here) and the first one counts the passes but does not order the array created and the … | |
You are the manager of a travel agency with 20 employees. You have announced a promotional campaign for your agents to sell vacation packages. Each day you will enter the ID number of the agent (#1-#20), the number of packages sold, and the dollar value of the package. Entries will … | |
i need help making this program i have to create a program that adds new customers if they arnt already in the database if they are calculate thier balance and if they wish to order anything that too alll in one program please help me .. | |
| [CODE]//how can make this program by composite class.plz conver this program using composition...............................! #include<iostream.h> #include<stdlib.h> class point { friend class circle; private : int x,y; point (int xx,int yy )//:(int x(xx),int y(yy)){} }; class circle{ float r; point p1,p2; public : circle (){r=0;} circle (int a,int b,int c,int d){ p1.x=a;p2.x=b;p1.y=c;p2.y=d; … |
How is IXRTextBlockPtr used? I have a XAML file that is made by Expression Blend. But the Silverlight project that corresponds to it has to be in C++ instead of C# (it has something to do with being part of an embedded system). The automatically gernerated C++ code referrs to … | |
this game is between a player and computer can you make it between two player please ? | |
Hi. I've been working with linked lists for a bit, but I've been having some trouble with them. My programming book does a good job in helping you make a linked list, but it does a bad job of showing you how to use them. What I am trying to … | |
Hey all, So i created a program that performs matrix addition and subtraction. It compiles but when I try to run it, it shows "SEGMENTATION FAULT" Help Please! Here are my codes: Matrix.h [code] #ifndef MATRIX_H #define MATRIX_H class Matrix { private: const int numRows, numCols; int **data; public: //constructors … | |
hey, I use DEV-C++ and I want to know how to display text in a new windows project. this code that i used from an example doesnt work. [CODE]#include <windows.h> #include<iostream> #include<string.h> /* Declare Windows procedure */ LRESULT CALLBACK WindowProcedure (HWND, UINT, WPARAM, LPARAM); /* Make the class name into … | |
In a nutshell: How can I statically link .dll files into my programs executable? I know it's possible, just have never done it before. I know there is also some issues that arise in doing so ( as well as bloating the executable's size ) but I'm still game for … | |
CONVERT THIS QUICK SORT PROGRAM INTO PARTITION OF 3,5,7OR 11 ELEMENTS. [CODE] #include"stdafx.h" #include<iostream> using namespace std; #include <stdio.h> #include <stdlib.h> #define size 50 void swap(int *x,int *y) { int temp; temp = *x; *x = *y; *y = temp; } int partition(int i,int j ) { return((i+j) /2); } … | |
i wrote some code to take an array and run it through a function to reverse the elements of the array and then return a pointer to the new array. For some reason im not getting the results i want. It has to do with my reverseArray function. Specifically in … | |
I'm trying to build my first template function, but it generates a compile error when lines 21 and 22 are not commented. What I'm trying to do is to have a template function that can return multiset<int>, multiset<double> or multiset<string> depending on the attribute I want to extracto from the … | |
In the display function when i output it shows multiple output for some agents, but i only want it to show the final one, how can i do this? [CODE]#include<iostream> #include<fstream> #include<conio.h> #include<iomanip> #include<cmath> #include<string> // Associating program identifiers with external file names #define in_file "data.txt"//input file name #define out_file … | |
Im having an issue with making a few test to overload the == operator in my linked list stack. i have the standard header files containing pop push and so forth. But Im having a problem writing these test. i was thinking maybe a test that would copy the stacks … | |
I have VS 2008, and QT. I wanted to know if I could include the .NET Framework and QT Framework in one application. How do you do this? Help! | |
I am having trouble ascending and descending an array with an insertion code. I know the while loop displays it in ascending order but i cannot get it to display from the original, ascending or descending. It just keeps repeating the first element in the array. Any help will be … | |
hi:) i'm writing a windows form program that controls 4 stepper motors, using visual studio express 2010, c++ i'm using a for loop that has to cycle for up to 1200 times. it works well enough but it's kinda slow and, when it's connected to my hardware and given more … | |
Hey there, working on a program thats going to have a bunch of functions, but for now I am stuck on something that will be reused throughout the program alot: passing a string pointer to a function. It may seem redundant or arbitrary that I am passing it as a … | |
Hello my problem is that I am not for sure my vector < vector < string > > addresses; is correct. What I am looking for is to read in from a file which looks like: name:dfsd@msn.com name:dfsd@msn.com name:dfsd@msn.com Once my code parses through the file, addresses should look like: … | |
Hello, How can I calculate the normal vector giving a vertex on a 2D plane in OpenGL. ? All what I read was all about 3D and cross product of two vectors. the only thing that I have is that vertex and I want to construct a vector coming out … | |
Hiya, I'm pretty new to C++ (using bloodshed dev). I am trying to display the path of a projectile (tennis ball) on a graph. I can do all of the calculations and output to a text file at each point however I can't find anything on the internet to explain … | |
Implement Quick sort algorithm with partition of 3 elements, partition of 5 elements, partition of 7 elements, partition of 9 elements and partition of 11 elements for the data set of 10000 elements. Can anyone tell me what is meant by "partition" in the above? |
The End.