1,177 Posted Topics

Member Avatar for daviddoria

This was just a goof on my part, but it was quite annoying and maybe it could be handled a bit better. I was on a different machine than normal, so I was not logged into daniweb but I didn't realize it. I found an interesting post and spent quite …

Member Avatar for Dani
1
162
Member Avatar for Labdabeta

I think your question would get better responses here: [url]http://forums.libsdl.org/viewforum.php?f=1[/url]

Member Avatar for Labdabeta
0
447
Member Avatar for benchz23

1) Please use code tags. 2) Use <iostream> instead of <iostream.h> (and similar for the other headers) 3) Use more descriptive variable names. What are x? y? i? 4) You'll have to give us a better idea of the problem. What is the current output? What is the expected output?

Member Avatar for daviddoria
0
178
Member Avatar for daviddoria

Is there a way to make a string variable in "normal" html (that is, not inside of a <script> tag)? I want to do something like [CODE] Number='005' <a href="http://domain.com/"+Number+".html">my link</a>[/CODE] Is this possible? Thanks, David

Member Avatar for daviddoria
0
103
Member Avatar for CrimsonGT

You can fix the warning: [code] The source directory C:/ne7ssh-1.3.2/src does not contain a CMakeLists.txt file. [/code] by commenting: [code] #add_subdirectory ( src ) [/code] Other than that, cmake ran fine for me (Fedora 13). I couldn't build it because I didn't install Botan, but the Makefile was generated successfully.

Member Avatar for vladoX
-1
494
Member Avatar for stan2000

Welcome to DaniWeb! To allow us to help most effectively, please use code tags when you post code. Also, you should always comment code as much as you can. When you post code that isn't working, you should also show the incorrect output (or any errors that occur). I also …

Member Avatar for richieking
0
3K
Member Avatar for plang007

I suggest you make a much much shorter example (20 lines instead of 200). The inputs should be hardcoded. You should be able to clearly demonstrate and show us the input, the current erroneous output, and the expected output.

Member Avatar for Arbus
0
234
Member Avatar for Blackiey

Before messing around with tictactoe, you should make some examples for yourself to make sure you understand the basics. Create a string and output it. Does it look correct? Stringstream works just like "cin" (an input stream). Here is a demo: [url]http://programmingexamples.net/index.php?title=CPP/StringStream[/url] David

Member Avatar for VernonDozier
0
917
Member Avatar for aztechkiraly

It is highly unlikely that anyone is going to do this for you. You should instead ask "How do I do this?". The c++ forum is probably not the right place for this question anyway. Which GUI framework are you using?

Member Avatar for daviddoria
-3
102
Member Avatar for student786

Welcome to DaniWeb! TO allow us to most effectively help you, please use code tags when you post code. Why are 'A' and 'result' their current size? Shouldn't they be much smaller if the code was written explicitly for 3x3 matrices? Also, about half of the code you have posted …

Member Avatar for daviddoria
0
166
Member Avatar for daviddoria

If I have this structure: [code] class Parent { public: virtual void MyFunction() {// do something} }; class Child { public: virtual void MyFunction() {// do something else} }; [/code] The Parent::MyFunction() seems to always be called, even with: [code] Child MyChild; MyChild.MyFunction(); [/code] Is this expected? David

Member Avatar for mike_2000_17
0
150
Member Avatar for Lelly

Please use code tags when posting code. Also, what is the problem? Please give us example input, current output, expected output, any errors, etc.

Member Avatar for mike_2000_17
0
185
Member Avatar for NV43

You seem to have defined the add() function but not a unian() function? If this is just a typo, please post code that should compile so we can see the whole structure.

Member Avatar for mike_2000_17
0
171
Member Avatar for daviddoria

I am working on some code (not written by be, and too big to fundamentally change the structure of) where a pure virtual Image class is implemented. The user is expected to implement a function of their derived Image class with signature: [code] virtual Rgb* GetRgb(); [/code] Where the Rgb …

Member Avatar for mike_2000_17
0
278
Member Avatar for Khoanyneosr

1) Be very careful, 'word' may be a reserved name on some systems. 2) You have declared an array of strings for 'guess' but I think you just want it to be one string? As Chilton pointed out, you have done this [icode]cin >> guess[50];[/icode] when I think you just …

Member Avatar for daviddoria
0
190
Member Avatar for sdr001

I suggest creating a function called OutputBinary(int lengthOfNumbers) and testing it by hardcoding a call to OutputBinary(3). This way you will be able to tell if the problem is with your output of if it is with your user input.

Member Avatar for sdr001
0
109
Member Avatar for chaithanyap

1) Use code tags. 2) include <iostream> instead of <iostream.h> 3) prefix cout with std:: 4) readb,c, and d must be void

Member Avatar for Ezzaral
0
875
Member Avatar for sreekiranws

I would start by switching from char arrays to std::string and from strcmp to .compare - [url]http://programmingexamples.net/index.php?title=CPP/Strings/Compare[/url] [url]http://programmingexamples.net/index.php?title=CPP/IO/ReadingLines[/url]

Member Avatar for Agni
0
424
Member Avatar for carlo0133
Member Avatar for vjackcon

For Linux, use gcc/g++. Then you will probably want an IDE such as KDevelop.

Member Avatar for Ancient Dragon
0
115
Member Avatar for margeaux54

I suggest simplifying this code as much as possible. That is, we don't need to see the encryption function at all to look for this problem. Typically by doing this, you will be able to see the problem yourself :) Also, explain the input, expected output, and current output.

Member Avatar for Ancient Dragon
0
123
Member Avatar for cppgangster

I think you're missing two semicolons: [code] #include <iostream> class Hop { protected: static struct NStrct { int nCount; } test; }; int main() { return 0; } [/code]

Member Avatar for cppgangster
0
175
Member Avatar for nabajyotip
Member Avatar for asymptotes14

I suggest trying to boil down your problems into very small demos. In many cases it will help you identify what is going wrong enough that you can solve it yourself. If not, it will produce a helpful question/answer pair for DaniWeb. Once you figure it out, if you don't …

Member Avatar for daviddoria
0
158
Member Avatar for daviddoria

I have been using a [icode]Image<Node>[/icode] as the main object to store the data for my program. It is a 2D grid of Node objects. The nodes have properties like [icode]bool Visited[/icode], [icode] float Priority[/icode], etc. I often want to modify these nodes, put some of them in a vector …

Member Avatar for daviddoria
0
166
Member Avatar for daviddoria

I realize this question may be impossible, but I'm pretty confused so I'm drawing at straws. I'm trying to use a class from a big library. If I do this: [code] TheClass imageIterator(image, region); [/code] everything works fine. However, if I do this: [code] TheClass imageIterator; imageIterator = TheClass(image, region); …

Member Avatar for daviddoria
0
251
Member Avatar for triumphost

If you want to use Qt it look like QConsole should do it: [url]https://sourceforge.net/projects/qconsole/[/url]

Member Avatar for paulmooreparks
0
206
Member Avatar for daviddoria

I have a class that has a function called Update(). I have written several different update methods, so I now have: [code] class MyClass { double Update1(); double Update2(); double Update3(); private: float Data1; ... float DataN; }; [/code] All of these functions need access to all of the data …

Member Avatar for mike_2000_17
0
110
Member Avatar for daviddoria

I'm having trouble with this "strict weak ordering". Consider a class Point with members x and y. I tried to make the comparison "If both the x values are less than each other and the y values are less than each other, the Point's are less than each other". However, …

Member Avatar for daviddoria
0
228
Member Avatar for Sundayy

A statement like this: [code] cin >> Total_Number_of_Seconds%3600; [/code] doesn't make any sense. 'cin' is trying to read something from the input stream and store it somewhere. Storing it in "variable%3600" doesn't make sense. Just store it in "variable". [code] cin >> Total_Number_of_Seconds; [/code] David

Member Avatar for Sundayy
0
788
Member Avatar for daviddoria

I am trying to return a vector of some of the elements in a vector. I wish to modify one of the elements in this new vector and have it automatically update the value in the original vector. I tried this: [code] #include <iostream> #include <vector> class TestClass { public: …

Member Avatar for daviddoria
0
153
Member Avatar for pritpal.singh88

You could look into SDL ([url]http://www.libsdl.org/[/url]). I know you can play audio files, not specifically sure about mp3s. Also, please use real English words like "please" instead of "plz". It helps to keep DaniWeb looking professional! David

Member Avatar for mike_2000_17
-2
2K
Member Avatar for ishaangt

VTK has some Geoviz capabilities: [url]http://www.vtk.org/Wiki/VTK/Examples/Cxx#Geographic_Visualization_.28Geovis.29[/url] but there may be better tools for this job.

Member Avatar for ishaangt
0
169
Member Avatar for criselda

I'm assuming you want to take numbers like 10.0 and 9.0 and output them such that they look like 10.0 9.0 If that is correct, it would be a perfect project for you to figure out how to do that and then add it as an example here: [url]http://programmingexamples.net/index.php?title=CPP[/url] David

Member Avatar for daviddoria
-3
31
Member Avatar for realproskater

That error likely means you are accessing an index outside of the contents of a string: [code] string a = "hello"; // valid indices are 0-4 cout << a[7]; // should cause that error [/code] Check the bounds of your loops, etc. David

Member Avatar for daviddoria
0
98
Member Avatar for daviddoria

On this page: [url]http://ewh.ieee.org/r1/schenectady/New/[/url] I have a <ul> element (the menu bar) followed by a <p> element (the main body text). Shouldn't the <p> be below the <ul> since it is a block element by default (instead of on the same line as it, as it is now)? Thanks, David

Member Avatar for johnsteve.bravo
0
614
Member Avatar for daviddoria

What I really wanted was a single class, ImageSegmentation<T> that operates on images of type T. The problem was that this object needed to be a member of my Qt form object (called Form), but I didn't know T until runtime (the user selects which type of image to operate …

Member Avatar for mike_2000_17
0
242
Member Avatar for Kaushalya

This is another one of those "common" questions that I am recommending cataloging: [url]http://daniweb.uservoice.com/forums/62155-general/suggestions/830529-create-a-wiki-to-catalog-answers-and-examples-?ref=title[/url] Please vote for it! Dave

Member Avatar for zwatsu13
0
14K
Member Avatar for smokin745

Have you gone through the tutorials here : [url]http://nehe.gamedev.net/[/url] (on the left side there are 52 OpenGL tutorials.) Once you distill some of that, if you could add some short code snippets here which demonstrate very particularly functionalities: [url]http://programmingexamples.net/index.php?title=OpenGL[/url] that would be a great exercise for you and very helpful …

Member Avatar for smokin745
0
193
Member Avatar for banh

Hi Banh, welcome to DaniWeb! The istringstream is a stringstream - it lets you "manipulate strings as if they were input/output streams." [url]http://www.cplusplus.com/reference/iostream/stringstream/[/url] You don't show how you have defined 'initial', but atoi could probably be replaced by another stringstream operation. Also, please use code tags when posting code. David

Member Avatar for banh
0
164
Member Avatar for thelerner

[code] for (i=0;i<4;i++) { for(j=0;j<4;j++) { cout<<list[i][j] << " "; // put a space between the characters on the same line } cout << endl; // start the next line } [/code]

Member Avatar for daviddoria
0
142
Member Avatar for icez17

"calling the condition function gives me error" - what is the error? There should be no problem calling a function from another function.

Member Avatar for icez17
0
246
Member Avatar for stankefa

stankefa, Welcome to DaniWeb! Try commenting line 23 and 24. You should see only the copy constructor called. On line 23, you are calling f(), so of course it will be called! Also, in the future, please use a descriptive thread title - for this question maybe something like "Copy …

Member Avatar for Fbody
0
198
Member Avatar for wondernaet

Welcome to DaniWeb. To help us help you most effectively, please use a descriptive thread title. Please also use code tags when you post code. It looks pretty "compact" (aka hard to read!) already to me! David

Member Avatar for sfuo
0
93
Member Avatar for lgonzo

Please post your code directly using code tags. Preferably, simplify the code as much as possible so that it only demonstrates the relevant parts.

Member Avatar for lgonzo
0
2K
Member Avatar for JordanHam

Why are you using [code]string term[]={"Jordan"};[/code] ? Why not just [code]string term = "Jordan";[/code] Also, why do you have quotes around[code]"term[i]"[/code] ?

Member Avatar for JordanHam
0
195
Member Avatar for myk45

1) I've seen something like this before: [code] class OSG_EXPORT Group : public Node [/code] to indicate that the class is part of a specific library ( I think used for wrapping by other languages?) 2) [code] Group(const Group&,const CopyOp& copyop=CopyOp::SHALLOW_COPY); [/code] I believe the first parameter is required and …

Member Avatar for myk45
0
142
Member Avatar for zabra
Member Avatar for daviddoria
0
2K
Member Avatar for MDiak47

You should definitely check out Qt. I have an introduction here: [url]http://rpi.edu/~doriad/Talks/Qt_Introduction.pptx[/url] and a bunch of examples here: [url]http://programmingexamples.net/index.php?title=Qt[/url] It will keep you pretty occupied! David

Member Avatar for mike_2000_17
0
163
Member Avatar for Crzyrio

I suggest you come up with a simple example problem, and then do the problem step by step by hand. Then step through the code with a debugger and ensure that it is doing every step the same as you did by hand. This will let you find the bug, …

Member Avatar for daviddoria
0
3K

The End.