49,761 Topics
| |
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 … | |
is it necessary to include base class in the header and or .cpp file of derived class? | |
I need to write an algorithm for finding the maximum weighted independent set of a graph, G. Any idea of where I should start? | |
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 … | |
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 … | |
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? | |
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. … | |
#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"; … | |
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> … | |
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 … | |
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. | |
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 … | |
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? | |
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 … | |
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.. | |
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 … | |
##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 … | |
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 … | |
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 … | |
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 … | |
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 … | |
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 … | |
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; … | |
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 … | |
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() { … | |
#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 … | |
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 … | |
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" … | |
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 … | |
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 … |
The End.