49,756 Topics
![]() | |
I just can't help but feel that there's a more efficient way to do this than with multiple calls to the string[i] operator. I've tried storing the results of string[i], but that leaves me with a char, which I'm evidently unable to compare. I know that I can compare a … | |
I want from you to give me a cpp code of a magic squire like this .. one dimention array takes 16 integers then put these 16 integers in 2 dimention array then test this array if it's a magic squire or not .. if not we will randomily rewrite … | |
hello :) i'm looking for an algo to find out all possible combinations of a 2d array entries, wich are (Tasks x Processors). i.e, i have to find out all possible schedules to schedule tasks against processors. numbers of tasks and processors are variable. Suppose : ............P1.......P2.......P3 .................................... T1........3 ........6..........4 … | |
The language i'm trying to do this in is c++ let's say i have a number 123456 , i want to divide this up into partitions of two so i would have: 12,34,and 56. I want to add the partitions up and it would equal 102. How can this be … | |
![]() | > My code Not working Why ???? there is some processor fault Error |
Purpose: Create a C++ class; use operators, overloading, member functions, friend functions, constructors and private data. • Make the data members private. (This means that the non-member functions below will have to be friends of the Data). • Create a member function called ‘set’ with the same arguments, and return … | |
Hi all, I have a simple OpenGL program (learnt from NeHe of course) and I've tried to implement GLSL shaders into my program. Currently, its meant to draw a cube with a shader and quit on escape. However, at the line **`GLenum program = glCreateProgramObjectARB();`** it stops responding and closes. … | |
Maybe I'm just missing something but I was thinking what do you call something like a Windows Form Application in Visual Studio where you can drag and drop and stuff like that. Do you call that an API or SDK or GUI or something else? By the way, as I … | |
I'm going over a practice exam right now and I've come across something I can't figure out. I understand what incrementing is but I just don't know why the answer is 0. //What is the value of a after the following code is run (int a=12). a += a -= … | |
I made a program, hangman. And I am trying to complete it. I have succesfully been able to compare the input letter by all the characters of the word to be guessed (which is saved in an char array) and display it. But now, I can not figure out how … | |
I have my project due of hangman and it is worrying me lately. I need to make a hangman game. I have studied arrays, functions, loops, if else statements. That is about it. I haven't done 2d arrays. Will do it now, because someone told me it is not possible … | |
guys i have hw to solve but i cant solve this Q !! any idea? ![29](/attachments/small/3/29.JPG "align-left") ![29](/attachments/large/3/29.JPG "29") | |
can any one help to create an dynamic (2*10) two dimensional array using new and delete? which ask user to enter the value and fill both row and column? I am able to create one dimensional but unable to create 2-D. | |
It's useless. Why are stupid classes in C++ having private members for? [snip] I am never using OOP in C++ I'm just using structs to organize data fuck OOP and classes it's so ridiculous to me that I'm SMH | |
#include<iostream> using namespace std; int main() { int Partnumber[15] = {112,130,156,173,197,150,166,113,123,143,167,189,193,117,176}; int Quantitynumber[15] = {12,30,56,17,19,50,66,13,12,14,16,18,19,11,76}; int hashTable[19][2]; int collisions = 0; int index = 0; for(int i = 0; i<15;i++) { index = (Partnumber[i] % 19); hashTable[index] = Partnumber[i]; if (hashTable[index] != 0) { do{ index++ }while(hashTable[index]!=0) } if(index >= … | |
I've written a Rational Class that takes fractions and can add, subtract, multiply, divide etc. I'm trying to keep my fractions reduced but for some reason, some but not all of my fractions are being reduced. I've posted my code below. I commented the fractions that aren't being reduced as … | |
Hi, I have read this on IBM: > > An exception specification may only appear at the end of a function declarator of a function, pointer to function, reference to function, pointer to member function declaration, or pointer to member function definition. An exception specification cannot appear in a typedef … | |
Im trying to run a sipmple program in c++ using openGL but get these errors... can somebody please help me? Error 1 error LNK2028: unresolved token (0A00002D) "extern "C" int __stdcall __glutCreateWindowWithExit(char const *,void (__cdecl*)(int))" (?__glutCreateWindowWithExit@@$$J18YGHPBDP6AXH@Z@Z) referenced in function "extern "C" int __stdcall `anonymous namespace'::glutCreateWindow_ATEXIT_HACK(char const *)" (?glutCreateWindow_ATEXIT_HACK@?A0x6d0c8cb1@@$$J14YGHPBD@Z) c:\Users\Surané\documents\visual studio … | |
hello, acually your site is helping me alots , thanx alots I have an assignemt n i stuck on readind data from user and hendle them as single string plzzzzz anyone can help me:( i tried alots and alots Write a C++ program that will make use of the following … | |
I'm trying to implement a template class called "Tree", here is the code for the main function: [code=c++] #include "Stack.h" #include <iostream> #include <time.h> using namespace std; int _tmain(int argc, _TCHAR* argv[]) { int gameObjects = 0; Tree<Player>* PlayerTree = new Tree<Player>; Player** players; players = new Player* [5]; Player* … | |
Dear All, I have function that works like this. Here # represnts one word while * is for one alphabet. Can anyone help me changing this code where # is for 0-N words, means it works if at # there is no word between dots, while for * there must … | |
Hi, working on a piece of code which loads in two images, one is a scrambled version of the other, compares them and then attempts to make a new image from the scrambled version. So far I've got it making a new image, comparing and unscrambling most of it, just … | |
![]() | I have a C++ application that I want to make more flexible and user-friendly. It currently contains seven nested for-loops, and part of the new flexibility is that this number will become variable (between two and twenty, say). What is the easiest way to achieve this? |
hello i am creating a tictictoe game , however i cannot get the program to check if the player has won or not . and produce a you have won message #include<iostream> #include"110ct.h" using namespace std; class TICTACTOE { CursorController*crs; ColourController*cl; int xplayer ; int oplayer; colour Cs; public: void … | |
I need implementation of this problem using ADT List. It should have at least 3 modules( classes). Help me please! A math teacher needs a program in order to help students to test different properties of numbers. The program manages a list of numbers and also allows students to repeatedly … | |
I have a project where I have to schedule 3 doctors for 28 days. Doc A, B, and C. The rules are: 1. They can't work back to back, but only on weekends. Example Doc. A can't work Monday and Tuesday, If Doc. A works Saturday, he must work Sunday … | |
void combination::OnButton2() { // TODO: Add your control notification handler code here m_progress.SetPos(0); m_progress.SetRange(0,100); combination a; a.make_combinations(0); } void combination:: make_combinations(int lo_val) { srand(time(0)); m_progress.StepIt(); ofstream fout("combination.txt",ios::app); ofstream fout2("time.txt",ios::app); for(int i=0; i<theApp.no_of_process; i++) { //m_progress.OffsetPos(100/4); //m_progress.SetStep(200); clock_t begin=clock(); arr[lo_val] = i; if(lo_val==(theApp.no_of_tasks)-1) { for( int j=0; j<theApp.no_of_tasks; j++) { int … | |
Hello everyone... I am new to the programmers world... Can anyone tell me if i can find a version of C or C++ for symbian? s60 v3? I want to write C/C++ programs but from my mobile phone... I have been searching the internet for the last 4 hours and … | |
Hello, Quick question.. I'm trying to get the mean of a matrix (vector) now before I created a function that did it but I thought that it isn't really an effective way of coding. I've been looking at the accumulate function online and wanted to ask if this would work: … | |
I need help in running a program that makes a SLR Parser Table. Here is the code : Code to find first and follow: saved as SLR.h #include<stdio.h> #include<ctype.h> #include<conio.h> #include<stdlib.h> #include<string.h> #include<iostream.h> #define epsilon '^' // since I didn't know how to type epsilon symbol temporily I am using … |
The End.