1,177 Posted Topics

Member Avatar for Rallici

There are a few problems. 1) You must #include <cstring> in player.cpp to use strlen 2) you have not given us main.cpp 3) You have declared wait() in globals.h, but not implemented it anywhere. Once you fix those we can start to look at the multiple definition of 'player'. Multiple …

Member Avatar for Rallici
0
243
Member Avatar for jrayborn66

Welcome to Daniweb! First, please use code tags around your code, it makes it much easier for us to read. Second, I STRONGLY recommend that you use std::vector instead of c-style arrays. It will save you hours of headaches for sure. Good luck, Dave

Member Avatar for nbaztec
0
183
Member Avatar for empror9

With first one, it looks like you need to compare to 'largest' each time. That is, [code] if(num2 > largest) largest = num2; if(num3 > largest) largest = num3; if(num4 > largest) largest = num4; [/code] For the second one, I would suggest using more descriptive variable names so you …

Member Avatar for hsh44
0
182
Member Avatar for mohamedhassan
Member Avatar for bbman

Are these [icode]ItemGroup^[/icode] supposed to be [icode]ItemGroup*[/icode]? If so, then I bet you are storing and using a pointer somewhere where you think you are storing and using the actual value. Dave

Member Avatar for jonsca
0
100
Member Avatar for dansnyderECE

You could look into the Boost RegEx package. Here is a short example [url]http://programmingexamples.net/index.php?title=CPP/TR1/Regex_Tokenising[/url] (maybe someone could comment /explain this a bit more)? Dave

Member Avatar for NathanOliver
0
125
Member Avatar for basics

Welcome to DaniWeb! Please use code tags when posting code, it makes it much more readable for us. This question seems to appear over and over again. Maybe someone can make example here: [url]http://programmingexamples.net/index.php?title=CPP#I.2FO[/url] of "correctly" reading a file one character at a time as well as one line at …

Member Avatar for daviddoria
0
176
Member Avatar for EmilyKirby

You should use getline() to get a line at a time as a string. Then you can use the [] operator to get each character and analyse it. Alternatively, you could use the std::count function: [url]http://programmingexamples.net/index.php?title=CPP/Strings/CountCharacters[/url] on each vowel. You may want to convert the whole string to lowercase (there …

Member Avatar for jonsca
0
78
Member Avatar for Mena samy

I haven't used it myself, but you could check out: [url]http://jocr.sourceforge.net/[/url] I urge you not to start from scratch, as this is quite a hard problem. Dave

Member Avatar for daviddoria
0
44
Member Avatar for Valaraukar
Member Avatar for Valaraukar
0
202
Member Avatar for deez2183

Welcome to DaniWeb! First, please use code tags when you post code. It makes it much easier for us to read. Second, PLEASE do not use global variables. The assignment even says that you should return the value by reference. The actual error you are getting is because you have …

Member Avatar for deez2183
0
469
Member Avatar for daviddoria

I hear perl is the way to go for string parsing, so here is the test! I have a file like this: [code] ... <li><a href="DSC_9866.JPG"> DSC_9866.JPG</a></li> <li><a href="DSC_9867.JPG"> DSC_9867.JPG</a></li> ... [/code] and I want to get a list of the file names. That is, the result I want is …

Member Avatar for daviddoria
0
90
Member Avatar for DelilahDemented

tesuji is correct. You can only switch on int and char. I have demonstrated the difference between char and string here: [url]http://programmingexamples.net/index.php?title=CPP/Switch#Switch.cpp[/url] Dave

Member Avatar for arkoenig
0
220
Member Avatar for daviddoria

Hi all, I have started a wiki that I hope to make the "unofficial Daniweb wiki". Its mission is to present short, compilable answers to many commonly asked questions here on the forum. [url]http://programmingexamples.net[/url] I have seeded it with a handful of c++ examples, but I'm hoping that some of …

0
31
Member Avatar for daviddoria

Hi all, I have started a wiki that I hope to make the "unofficial Daniweb wiki". Its mission is to present short, compilable answers to many commonly asked questions here on the forum. [url]http://programmingexamples.net[/url] I have seeded it with a handful of basic operations. Please feel free to edit, add …

Member Avatar for Bench
4
151
Member Avatar for daviddoria

Hi all, I have started a wiki that I hope to make the "unofficial Daniweb wiki". Its mission is to present short, compilable answers to many commonly asked questions here on the forum. [url]http://programmingexamples.net[/url] I have seeded it with a handful of c++ examples, but I'm hoping that some of …

1
45
Member Avatar for KAY111

I strongly suggest trying to narrow the code down to the smallest piece that will give you that compiler error. From what you've posted, I can't tell that Xnode, Ynode, and arc are defined anywhere that the compiler should know about. Why are you using this ghastly define? Why not …

Member Avatar for Taywin
0
2K
Member Avatar for anu07

There are "disassemblers", that will go from an executable to assembly, but you'll never get back to c++ :(

Member Avatar for anu07
0
117
Member Avatar for daviddoria

I am trying to rally some troops to make some additions to WikiVersity - anyone interested? [url]http://www.pledgebank.com/openeducation[/url] Dave

0
42
Member Avatar for bklearner

What is wrong with it? Give us a sample input, current output, and expected output. Does it crash? If so, have you used a debugger to track down where? Dave

Member Avatar for Taywin
0
148
Member Avatar for daviddoria

I've seen that a vector can be sorted using [code] vector<double> V; vector<int> Index; V.push_back(9); V.push_back(10); V.push_back(8); Index.push_back(0); Index.push_back(1); Index.push_back(2); sort(V.begin(), V.end()); [/code] If I want to sort Index according to how V was sorted, there is an optional third parameter to sort() that will do this. I don't understand …

Member Avatar for daviddoria
0
2K
Member Avatar for allonline

If you store your new structs that AncientDragon suggested in a std::vector, you can then use sort() from STL <algorithm> Dave

Member Avatar for peter_budo
0
342
Member Avatar for vbx_wx

You can't! I supposed you could convert the int's to strings and push them all in as strings. What are you trying to do? I bet there is a better way. Dave

Member Avatar for Radical Edward
0
129
Member Avatar for anita_jojo20

anita_jojo20, Welcome to DaniWeb! Let me offer a few suggestions that will make your time here as useful as possible. Please use only real English words. I.e. 'plz', 'meeeeee', 'tx' are not words. griswolf seems to have provided an excellent description of the through process you should be using. I …

Member Avatar for griswolf
0
183
Member Avatar for bubacke

Good question. Place the code between code tags, like this: [ code] here [ /code] (without the spaces between the brackets and the words)

Member Avatar for bubacke
0
132
Member Avatar for FudgeCoder

You may find more help here: [url]http://www.eclipse.org/forums/[/url]

Member Avatar for theABCasian
0
126
Member Avatar for mattloto

Linux has the concept of pipes to communicate between executables. Since you are saying "exes" I'm assuming you're in Windows, in which case I have no idea. You could always write to a file from program A and then read the file from program B, the problem would then be …

Member Avatar for mkvist
0
290
Member Avatar for hisugan

Do you have a specific question? Please post your attempts at these things and we'll try to help you debug them. Dave

Member Avatar for mattloto
0
267
Member Avatar for sashaa

Not that we would do your project for you even if we have the details, but wit the information you have provided we can't give you any direction at all!

Member Avatar for daviddoria
0
39
Member Avatar for maney

Welcome to DaniWeb! Can you please be more specific? Maybe looking at ifstream and ofstream will get you started? Dave

Member Avatar for daviddoria
-4
59
Member Avatar for SCoder1

wxWidgets is a GUI system. Here is an example: [url]http://www.wxwidgets.org/docs/tutorials/hello.htm[/url] You have to run [code] wx-config --libs wx-config --cppflags [/code] to get the settings from your system. Then you have to setup your build. I use cmake, so this is how to do it in cmake: [code] cmake_minimum_required(VERSION 2.6) PROJECT(Basics) …

Member Avatar for daviddoria
0
89
Member Avatar for blindkilla

Please try to delete code until you are left with the shortest program that demonstrates the problem. For this type of error, we don't need the logic of the program, just the structure.

Member Avatar for blindkilla
0
108
Member Avatar for Griff0527

You should use the count() function from STL algorithm [code] #include <algorithm> start = Vect.begin() ; end = Vect.end() ; result = count(start, end, value) ; [/code] (There is also a sort() function, but you shouldn't need it here) If you wanted to do it more manually you should use …

Member Avatar for NathanOliver
0
1K
Member Avatar for Tom Gunn

Why would a test driver confuse people?? That seems to be a very critical part of an example like this!

Member Avatar for daviddoria
1
734
Member Avatar for gomezfx

Welcome to DaniWeb! Looks good to me. You should write a main function to instantiate the class and call the print function. Does it compile without errors and produce the correct output? If so then I think you're good to go! Dave

Member Avatar for nbaztec
0
91
Member Avatar for strwbry.coder

You have to use ofstream, not just fstream. [code] else if (choice == 2) { ofstream outfile; // file declared outfile.open("output.txt"); // opening txt file cout << "Please set the following for your Log In information:\n" << "\nUsername: "; cin.ignore(); getline(cin, log.username); outfile << log.username << std::endl; // not sure …

Member Avatar for mrnutty
0
202
Member Avatar for jsw24ua

Welcome to DaniWeb! (First, please use code tags when you post code!) You should use a [icode]std::vector<std::string>;[/icode] Give that a shot and let us know if you have a specific problem. Dave

Member Avatar for jsw24ua
0
175
Member Avatar for andrewll2

Hi Andrew, Unfortunately I don't know the answer to your question. However, I urge you to make the titles of your threads as descriptive as possible. For example, I came to look at "A little problem", but quickly found out that it was related to the Windows API and I …

Member Avatar for andrewll2
0
221
Member Avatar for Roses89

That line is the constructor. It says to use a default value of 1.0 if nothing is passed. If something is passed, the [icode] : radius(r)[/icode] sets the member variable 'radius' to the value of 'r'. This is called an 'initializer list'. Dave

Member Avatar for Roses89
0
108
Member Avatar for flaviusilaghi

Where does the error occur? If it is on this call [icode]ASN1_parse()[/icode] then you're question definitely needs to go to the OpenSSL community. Dave

Member Avatar for flaviusilaghi
0
276
Member Avatar for Finconizer

For that question, I'd start here : [url]http://www.daniweb.com/forums/forum4.html[/url] However, I'd ask why you would want to use such an old language?

Member Avatar for nbaztec
0
148
Member Avatar for Leppie

Both functions should simply return an int (by value). Simply change [icode] void FunctionName()[/icode] to [icode]int FunctionName()[/icode] and at the end of the function, after you [icode] cout << something;[/icode] now you need to [icode]return something;[/icode]

Member Avatar for daviddoria
0
148
Member Avatar for Hawkpath

I would look into a GUI system such as Qt4. This will allow you to make professional looking applications. Dave

Member Avatar for NathanOliver
0
139
Member Avatar for kiwimoosical

One helpful hint - please use a descriptive thread title, for example instead of "HELP!!!!!", say something like "Trouble with input and if statement". Dave

Member Avatar for Ancient Dragon
0
229
Member Avatar for daniel88

I have a feeling that most of us geeks here are going to need a better explanation of what these rankings (0-3) mean, and a bit of an English explanation of what is going on before we can look at your code simulation.

Member Avatar for daniel88
0
113
Member Avatar for LevyDee

This error typically means that the file clientList.cpp is not linked to by the project. Try to produce the fewest lines of code that will produce this message and we can check if anything else looks wrong of if the project is simply mis configured. Dave

Member Avatar for LevyDee
0
69
Member Avatar for Ganty722

Ganty722, Welcome to DaniWeb! I recommend looking into ifstream. Once you do that if you still have problems post the code of what you've tried here and we'll see if we can help you figure out what is wrong. Dave

Member Avatar for daviddoria
0
86
Member Avatar for vsawant

vsawant - Welcome to DaniWeb! Let me give you a few pointers to ensure your stay here is as successful as possible. 1) Please do not "hijack" threads. That is, your post here was not related to the original question. In this case, you should start a new thread rather …

Member Avatar for ZootAllures
-1
151
Member Avatar for sasTReSS

Do you have code to make a tree with 2 leafs per parent? Show us this and indicate where you think it would need to be modified to make more than 2 leafs, and we'll see if you're on the right track. Dave

Member Avatar for sasTReSS
0
1K
Member Avatar for RehabReda

That is a pretty serious application! I would certainly not start out with something anywhere near that complex! I'm not even sure c++ would be the right language to start a project like that with.

Member Avatar for nbaztec
0
109

The End.