49,761 Topics

Member Avatar for
Member Avatar for eric.inclan.3

Hi all. I've been learning programming from the web for almost 2 years now and this'll be my first post ever on DaniWeb (or any forum ever). I have no experience with parallel programming but read about the simplicity of working with OpenMP, and that's what I need. Something that …

Member Avatar for eric.inclan.3
0
514
Member Avatar for MRehanQadri
Member Avatar for jborden

I need to write an algorithm for finding the maximum weighted independent set of a graph, G. Any idea of where I should start?

Member Avatar for deceptikon
0
146
Member Avatar for craig.durnin.1

This is quite complicated to explain, so I will do my best, sorry if there is anything I missed out, let me know and I will rectify it. My question is, I have been tasked to draw this shape, ![Crescent Moon](http://www.learnersdictionary.com/art/ld/crescent.gif) This is to be done using C++ to write …

0
83
Member Avatar for waqas.zafar.125

hey guys ! i am unable to understand how to implement the function insert at head and insert at tail .. class Book { public: char * title; float price; // constructor for class Book Book () { char* title = new char[20]; strcpy(title,"untitled"); price = 0 ; } void …

Member Avatar for rubberman
1
181
Member Avatar for tomz6

Is it possible to store data to CPU memory, if so how much memory can I store and how? Say I wanted to store an array, about 6MB in size?

Member Avatar for rubberman
0
238
Member Avatar for gelmi

Hi, i just don't know why does this program is wrong, the problem is if I choose 1 and 3 . after I choose choice no.1, I enter the employee id and name nothing happens after that, same as choice no.3 which I will enter the employee id to find. …

Member Avatar for rubberman
0
165
Member Avatar for tanmay.majumdar2

#include <cstdlib> #include <ctime> #include <iostream> #include<conio.h> #include<string.h> /* time */ using namespace std; char square[10] = {'o','1','2','3','4','5','6','7','8','9'}; void box(); void player1_won(); void player2_won(); void fu(); int main() { srand((unsigned)time(NULL)); int abcd[45]; char type[34]; string data[56]; again: string x[3], z="sayTanmayRoxx", p; char f, g; int a; int d; cout<<"enter password\n"; …

Member Avatar for rubberman
0
215
Member Avatar for dreday92

I am having a few compiling errors due to the syntax confusion on some the functions, Im confused to what im doing wrong, I know its a simple solution I've just been looking at this for hours and cant figure it out. //Header File #ifndef BST_H #define BST_H #include <iostream> …

Member Avatar for rubberman
0
265
Member Avatar for ireallyneedhelp

ok guys i really need help my friend asked me to help him with his assignment can help me at least give a guide where and what to do? Accept the month. Accept the name of each staff. (Assume that there are only 5 marketing staffs) Accept the number of …

Member Avatar for rubberman
0
186
Member Avatar for tomz6

How can I import a font file and get the pixel information of the letters so I can make my own custom text drawing function? I basically have a pixel surface (a 2D array) and I want to draw the text to that array.

Member Avatar for rubberman
0
125
Member Avatar for elmousa

I am in the process of writing a program for our department as follows: We have about 40 field directorates in addition to the central department. Each field directorate has its own LAN and is connected to the central department through our WAN. I need to write a program that …

Member Avatar for elmousa
0
251
Member Avatar for tomz6

Does anyone know of an easy way to get the computer to do separate tasks for each core? Assuming each task has no memory collisions etc. how can I get each core to work on it's own separate block of code?

Member Avatar for mike_2000_17
0
200
Member Avatar for Martje

I am having a dialog box opens that lets you select a picture and then copy that picture to another folder but the problem is that i am having an error that says that i can't convert a System::String to a LPCTSTR. I searched this subject on google but i …

Member Avatar for Suzie999
0
308
Member Avatar for Awais Ali

hye guyz, Can any one tell me that what the data structure is used behind FACEBOOK ??? I have googled but not found any useful answer... plzz tell me quickly..

Member Avatar for BigBang@12
0
829
Member Avatar for tomz6

I'm just curious if anyone knows if there is a ready made function in C++ to sort (numerically or alphabetically) multiple arrays based on a particular array? i.e. Imagine you have multiple arrays or a multi-dimentional array containing data about users (name, age, etc.) Is there a function that for …

Member Avatar for Eagletalon
0
142
Member Avatar for poopoowei

##TASK Step One The DNA molecule is a double-helix. You can think of this double helix as two parallel sequences of DNA with nucleotides or bases (A,C,G,Ts) on one strand matched with their associated nucleotide on the other strand according to the following rules: A matched with T C matched …

Member Avatar for poopoowei
0
334
Member Avatar for sadben.khan

I'm working on an assignment in which we aren't allowed to use arrays or functions. So i need to use loops to split words from a text file. I got most of the code working but i get an error at this part where the loop doesn't exit when i …

Member Avatar for sadben.khan
0
224
Member Avatar for sadben.khan

So the "substr" command is used for extracting certain characters, i have a problem in which if the character is a space, the previous value is used for filling the variable The code: #include "stdafx.h" #include<cmath> #include<string> #include<iostream> #include<sstream> using namespace std; int _tmain(int argc, _TCHAR* argv[]) { string line="Introductory …

Member Avatar for sadben.khan
0
132
Member Avatar for wids101

i'm writing a cashier like program and i need help with the setfill code. i wrote "cout << "Item Cost: " << setw(8) << cost << setw(10) << setfill('=') << endl;" and the result is "Change Due: ======5" I want the equal sign to be on the next line all …

Member Avatar for wids101
0
223
Member Avatar for Martje

Hey guys, I am having a problem where i want to print a image and a simple string. i would want that when i print i get this on paper : [Click Here For Image](http://img339.imageshack.us/img339/9308/wiw.png) I looked up printDocument, printDialog and printPreviewControl from MSDN and got a few examples but …

Member Avatar for tinstaafl
0
347
Member Avatar for Echo89

Hello, I have been learning how to use the MS WinAPI, but their documentations is extremely vague in a lot of places, without information on the proper use of functions (PHP.NET manages this just fine!). But anyhoo. When I handle the WM_DRAWITEM message, it SHOULD display an image on the …

Member Avatar for Echo89
0
1K
Member Avatar for ConfusedLearner

Define an integer vector and get several input from keyboard, then display the numbers in the vector. The while loop is required to write the display loop. I am having trouble turning my program into a while loop and getting mistakes. Please help. #include <iostream> #include <vector> using namespace std; …

Member Avatar for Banfa
0
154
Member Avatar for jingoria

Hi guys, I am bit puzzled with a requirement on my program: Say I have a class A with some private variables class A { private: string variabe; }; Then I have class b with some other private variables class B { string varialb1; }; Now I have a class …

Member Avatar for Banfa
0
263
Member Avatar for juan.sancen.7

I have some problems in my program. I have to read info from input files and display a message. This is what I have: #include <iostream> #include <fstream> #include <iomanip> using namespace std; void Printing(ofstream& outFile, int& percentFat); void Percent(float& fatGrams, float& cal, float& fatCal, int& percentFat); int main() { …

Member Avatar for deceptikon
0
214
Member Avatar for opawix

#include <string> #include <iostream> #include <algorithm> int main() { using std::string; using std::cout; using std::endl; using std::replace; string s("name"); replace(s.begin(), s.end(), 'n', 'x'); replace(s.begin(), s.end(), 'a','x'); cout << s << endl; system("pause"); return 0; } Here is my code. this code output= xxame. my desired output is that their is …

Member Avatar for Lucaci Andrew
0
142
Member Avatar for Xorlium

Hello! I'm writing some mathematical iterators over some big classes that I don't want to store in memory at all, but I still want to be able to iterate through them. As an example (but I have a few of these), think of a class `Combinations({0,1,2...7}, 3)`, which means I …

Member Avatar for Xorlium
1
323
Member Avatar for ralph.d.abernathy.1

Hello all. I'm writing a program that converts from any cominbation of base 2, 8, 10, and 16. So far I have this code and I want to convert from hexadecimal to octal but it doesn't work. I would appreciate any help. Thank you! Here is the code: #include "stdafx.h" …

Member Avatar for Nutster
0
498
Member Avatar for tyler.dahle

void runGame(){ readimagefile("PIX\\Landscape.jpg", 0, 0, 800, 800); while(1 == 1){ moveCharacter(); //moveMonster(); } } void moveCharacter(){ int move = 0; int size = imagesize(0, 0, 800, 800); void *background = malloc(size); getimage(0, 0, 800, 800, background); readimagefile("PIX\\Character\\down_still.gif",x9,y9,x9+50,y9+50); thunderClaw(); //specialAttack(); //thunderball(); if(kbhit()){ if(getch()== 'd'){ move = 1; } if(getch()== 'a'){ move …

Member Avatar for tyler.dahle
0
198
Member Avatar for sgw

The number D computed by the following polynomial formula D=(pow(i,5.)/120)-(pow(i,4.)/12)+(23*pow(i,3.)/24)-(83*i*i/12)+(571*i/30) should always be an integer, when i=1,2,3,4,5,.... However, for some i values, each separate term may not be an integer, but when putting together (with additions and subtractions) in the above formula, any non-integer parts would be "cancelled out", and …

Member Avatar for sgw
0
160

The End.