49,761 Topics
| |
Here is my problem. I have a class Template define like this. [CODE]// File Vecteur.h template<class Elem> class Vecteur : public AdenEtEve { public : ... BOOL bInserer (Elem &elemAInserer, MOT32 wIndice);` ... protected: Elem elem; Elem *pElem; MOT32 wNbElem; } template<class Elem> BOOL Vecteur<Elem>::bInserer (Elem &elemAInserer, MOT32 wIndice) { … | |
I'm working on a program to write chemical reactions a certain way from a file, calculate the mass and check whether they are conserved. I have this code so far: [CODE]#include <iostream> #include <fstream> #include <string> #include <sstream> using namespace std; #define INDEX_H 0 #define INDEX_B 1 #define INDEX_C 2 … | |
For example, if I have the number 142, how do I know it contains the digit 1, 4, and 2? So far, I've worked out that 142/100 =[B] 1[/B] 142 - (1*100) = 42 42/10 = [B]4[/B] 42 - (4*10) = [B]2[/B] So i can just use a looping system. … | |
| |
Some things you need to know: [LIST] [*]This code is not efficient, if you want a more efficient solution, then turn to the STL algorithm [URL="http://www.cplusplus.com/reference/algorithm/next_permutation/"]next_permutation[/URL]. [*]When there are double characters (i.e. characters which occur multiple times) in the string to permute then some permutations will be generated multiple times. … | |
Hi I'm building a webservice in axis2c and wanna test it with a client. I build the skeleton code for the client using the wsdl2c tool in axis. Now, when I build the solution in Dev-C++, I get a lot of linker errors like the one mentioned in the title: … | |
[b]Split from - [url]http://www.daniweb.com/forums/thread34812-2.html[/url] [/b] hi can you help me with my problem in c++ coding? my problem that in every two zeros it must fallowed by 1, to become valid if the input is not 001 like this it becomes invalid..... example: 001001001 - valid 001010001-invalid | |
hi i m mahesh i want to knw about the project on media player[QUOTE=mattybennett;660156]Hi all, Ok - there's nothing like a BIG challenge to start off my exploration into programming. Given that I'm a complete newbie with more build errors than a builder having a bad day (bad pun!), what … | |
I am stuck with one problem , please anyone help me to do this . The question is Write a function to modify a list ( [I]one dimensional array[/I] ) of numbers such that every number is replaced by the average of its immediate neighbours ( [I]the value just above … | |
/*I am a noob and can not seem to be able to pass a random number to cout. I have tried everything amd am looking for a little guidance*/ [CODE]#include <iostream> #include <ctime> using namespace std; class Fraction { private: int num; // Numerator int den; // Denominator public: int … | |
had to do a program that did a binary search for the number 5 but for some reason its not being found...here's my code whats wrong.. [code] #include <iostream> using namespace std; const int SIZE=15; int binarySearch(const int, int, int[]); int main() { int posints[SIZE]={10, 36, 87, 95, 100, 110, … | |
In this class, line 3 "char * pName" and last line "char * name" pName and name are pointers or strings? I think they are pointers but if they are pointers how can we do strlen(pName) and strcpy(name,pName) in the code? Thanks class student { public: student(char * pName="no name",int … | |
Hey guys I overall got this problem solved it has to allow the user to input numbers to do artithmitic functions to fractions. And the whole mathmatical works fine. But the professor wants it to loop, and i cant figure out a good way to loop it. The way the … | |
My teacher issued an assignment for us to implement a stack and node class based off of his header files, and then to code a postfix expression calculator using the stack and node classes that we implement. When I tried to generate an instance of my stack class, VS threw … | |
Hey guys so have an assignment for my computer programming class, i was wonder if you could help me out. im really at a loss here haha, this is basically what i have to do and if anyone has a similar program that would help me out that would be … | |
Hello, I have a weird problem. I have a class implemented that looks something like the following: [CODE] class textBox { public: // default constructor textBox() { m_text = ""; } textBox(string text) { m_text = text; } string getText() { return m_text; } private: string m_text; }; [/CODE] Now, … | |
heres my code: [CODE]#include<iostream> #include<string> #include<iomanip> #include<fstream> using namespace std; struct WeatherInfo { string City; //Name of the city double Rainfall; // Total rain fall of all citys double High; //Highest temperature of all citys double Low; //Lowest temperature of all citys double Average; //Average temperature of all citys }; … | |
[CODE]#include<iostream> #include<cmath> using namespace std; int main() { float user1; float user2; float sum; char choice; for (;;) do { cout<<"Calculator"; cout << "Enter your first number" << endl; cin >> user1; cout << "Enter your function \n"; cout << "+ \n"; cout << "- \n"; cout << "x \n"; … | |
Nevermind. No one answered but I got it now. | |
hello , I am creating a map format for a game I'm making and I'm hoping to use xml. Can anyone tell me how to access elements using tinyxml ? or at least how create some sort of pain text parser ? Thanks in advance ! A Novice C++ Programmer | |
ok so i need to create a cell class for a tic tac toe game. the cell class should have a row, column coordinate, and an internal and external display value. heres what i have so far. can anyone give me some hints or point me in a direction where … | |
ok so i worked on this during lunch at school since i was bored, but here it is so far. [CODE]#include <iostream> #include <cmath> int main() { using namespace std; int badguy1; int action1; int action; int att; int def; int health; int shop; int action2; int action3; int action4; … | |
Hi everyone, I have to display a binary search tree in a tree format. For BST insertion, if the input contains the following F D R P V M N The resulting BST should be displayed as: [CODE=text] F +-- D | +-- NULL | \-- NULL \-- R +-- … | |
Hello all, I am a major noob a C++ and need some help with managing case. we are to write program that asks the user to enter a temperature and a single letter, F for Farenheit or C for Celsius. The program should manage the upper or lower case input … | |
I have a homework assignment for my algorithms class, we need to take up to 10 user inputted locations and then plot out the route from a static point, displaying every possible route to take. What I'm wondering is is there a way to randomly display a string array and … | |
Hi, I am trying to comprehend how exceptions work in c++. However I don't understand why a divide-by-zero exception es not caught by a catch. I attach de code to a better a explanation. [CODE] #include <iostream> //#include <exception> #include <string> using namespace std; int main () { int num1, … | |
Alright, this is the best text based RPG I have created, and I have refined all the bugs and such. I have gotten a few questions on whether it is beatable without dying, and it IS beatable without dying, but be aware that you most likely will die quite a … | |
Hi every body... this(attachment) is my code for implemention of Huffman code,this code must read every file and compress them, it works on many test file but if I input test.txt it give an Error... How can i solve this error ... and the next problem is if we input … | |
I'm currently working on a project that makes use of the FIX protocol and my role in my group is to work on decoding information that would be sent in the data stream but, after reading many of the specification docs on fixprotocol.org, I am still at a loss as … | |
Hi everyone, new to the DaniWeb community, i have always used it for homework help in the past, but i'm about to rip my hair out if i stare at this code for another hour. basically the project is to write a code that reads data from a file, gets … |
The End.