1,177 Posted Topics

Member Avatar for iAMyours

You should look into fstream to write data to a file, and iostream to read input from the command line.

Member Avatar for [Prototype]
0
2K
Member Avatar for Tiancailee

This is probably a better question for this forum: [url]http://www.opengl.org/discussion_boards/[/url]

Member Avatar for daviddoria
0
253
Member Avatar for drakeanoid

I would suggest making a very small (<20 lines) example of one piece of your program that is not working. In many cases, by breaking it down like this you will solve your problem on your own :)

Member Avatar for Ancient Dragon
0
593
Member Avatar for nora-s
Member Avatar for daviddoria

I typically make a Types.h to define all of my types in and then include that in all of my project files. I haven't ever seen this anywhere though, so I assume it is "bad/wrong". The situation is often like this: Consider a class Gardener that needs to know type …

Member Avatar for mike_2000_17
0
134
Member Avatar for NvIs

You will save yourself countless headaches by not using double arrays, but rather double vectors: [url]http://programmingexamples.net/index.php?title=CPP/2DVector[/url]

Member Avatar for PCSO
0
4K
Member Avatar for literal

This line [icode]if(!(i%j)) break;[/icode] says "if you can divide i by j evenly (with no remainder), i is not prime". It could be more clearly expressed as [icode]if(i%j == 0) break;[/icode] I'll leave the next line for someone else :)

Member Avatar for Distantearth
0
164
Member Avatar for daviddoria

I just watched this webcast: [url]http://videos.webpronews.com/2011/05/31/daniweb-speaks-out-on-recovering-from-google-panda/[/url] I'd like to follow up on the idea of no-indexing threads with zero replies. During the webcast it was stated that the idea was to not have people find a thread that has their exact question but no answer. In some cases, they will …

Member Avatar for Dani
0
227
Member Avatar for s11049151

The key to recursion is defining a base case. Here the base case should be "making change for a penny?". Take a look at this: [url]http://programmingexamples.net/index.php?title=CPP/recursion[/url] and see if it points you in the right direction. You'll probably need to define an array with the possible values of a coin: …

Member Avatar for daviddoria
0
271
Member Avatar for SpecialForce

If that is your entire program, you are definitely missing main(). From main, it looks like you should call gdiscreen(). The "identifier not found" would be fixed by adding a declaration before you call the function: [code] int GetEncoderClsid(const WCHAR* format, CLSID* pClsid); [/code] David

Member Avatar for daviddoria
0
6K
Member Avatar for garber
Member Avatar for cousinoer5

When you output a pointer, you will certainly get its address. That's what a pointer is, just an address. When you dereference the pointer and print that, you'd have to have the << operator defined. [code] friend std::ostream& operator<<(std::ostream& output, const Point &P); [/code] Here is a full example: [url]http://programmingexamples.net/index.php?title=CPP/OverloadOperator[/url]

Member Avatar for Chilton
0
179
Member Avatar for daviddoria

n windows I used GDI+ to capture a region of the screen. Is there something similar for linux? I want to do ScreenCapture(Top, Left, Width, Height); and save it to a file (png or something). What's the easiest way to do this? Thanks, Dave

Member Avatar for Mual
0
1K
Member Avatar for joru819

Please explain what is going wrong. If possible, try to shorten the code and have it still produce the problem.

Member Avatar for abhimanipal
0
108
Member Avatar for daviddoria

Hi all, I am trying to write a function to solve an equation for one of its variables. E.g. X + Y + Z = 0 This equation would be represented by its parameters: parameters[0] is X, parameters[1] is Y, parameters[2] is Z. If the user wants to solve for …

Member Avatar for mrnutty
0
742
Member Avatar for SWEngineer

You should make the title more descriptive - like "Qt linker errors". Also, you will probably have better luck here: [url]http://www.qtforum.org/[/url]

Member Avatar for SWEngineer
0
496
Member Avatar for programing

Whenever you're having an error you can't track down, the first thing I would suggest is to remove all user input and hardcode values that you know the correct behavior of. You should then try using a debugger to step through the code while watching the variables to see if …

Member Avatar for Lerner
0
138
Member Avatar for MagnetoM

This seems like a better question for a Microsoft forum. It is not really c++ related.

Member Avatar for daviddoria
0
73
Member Avatar for slaidas

You could make a character array and then create random numbers: [url]http://programmingexamples.net/index.php?title=CPP/RandomNumbers[/url] as indices to the array and output the character at the random index. This would all be done in a loop.

Member Avatar for WaltP
0
150
Member Avatar for XCC111
Member Avatar for aragant
Member Avatar for mrnutty
0
195
Member Avatar for TriG0rZ

My only guess would be: [icode]LecERDClick(this)[/icode] but you'd probably be better off asking whoever wrote this.

Member Avatar for daviddoria
0
86
Member Avatar for mushimushianone
Member Avatar for daviddoria
0
60
Member Avatar for HashIncludeDotH

You'll probably have better luck here: [url]http://tech.groups.yahoo.com/group/OpenCV/[/url] (Their data structures are really wacky - good luck :) )

Member Avatar for daviddoria
0
213
Member Avatar for CrazyProgrammer

I'd bet you Qt has some widgets that are searchable. I've never used them, but it might be worth looking into. Also, are you sure you need to do this in c++? People tell me that perl is the way to go for string manipulation/searching/etc.

Member Avatar for daviddoria
0
141
Member Avatar for همس.

Sounds like fun! I'll tell you what, since it's so much fun, I'll let you give it a try first! When you get stuck (show us the code and a specific problem you're having, precisely stated), we'll chime in.

Member Avatar for daviddoria
-8
88
Member Avatar for boot-baby-boot
Member Avatar for daviddoria
0
96
Member Avatar for daviddoria

I was under the impression that you could completely gaurd anything you wanted with an [icode]#if 0 [/icode]. Apparently this is not the case? I found some code that has opening /* comments but no matching closing */, and the /* seems to comment out the [icode]#endif[/icode], resulting in everything …

Member Avatar for daviddoria
0
135
Member Avatar for Zvjezdan23

I strongly suggest breaking down your problem into tiny pieces. People are much more willing to help you solve generally useful problems rather than your specific problem. For example, if you start a thread asking "How do I erase a line from the terminal?" you will likely get some answers, …

Member Avatar for daviddoria
0
219
Member Avatar for Kontext

You have to make sure that the GL directory (if you use gluh.h) or the directory that contains the GL folder (if you use GL/glut.h) is on your "include path". Depending on your environment (Visual Studio, etc) the method to set the include path varies. As a test, try #include …

Member Avatar for daviddoria
0
251
Member Avatar for rumala13

First, please use real words (anyone vs any1). Second, where did you see this cpuh.h ? We need some context.

Member Avatar for daviddoria
0
79
Member Avatar for daviddoria

If I want to generate all combinations of a set of numbers 0-max, I can do so with for loops. The following code will output all two-number pairs: [code] for(unsigned int i = 0; i <= max; i++) { for(unsigned int j = 0; j <= max; j++) { cout …

Member Avatar for nezachem
0
211
Member Avatar for BobTheLob

There is nothing magic about compiling something with a GUI. You simply have to link to the GUI library (in your case Wx) that you want to use. You can see the setup with CMake here: [url]http://programmingexamples.net/index.php?title=CPP/WxWidgets/Basic[/url]

Member Avatar for daviddoria
0
338
Member Avatar for exca

Why not just make a loop over the index instead of having a separate explicit loop for each index?

Member Avatar for Momerath
0
147
Member Avatar for sahil1991

Please use 'code' tags instead of 'program' tags. Also, please use real words instead of "frndzz, bt, dun knw wats wrng".

Member Avatar for daviddoria
0
136
Member Avatar for leonziyo

I suggest making the smallest possible compilable code that demonstrates the problem you are having with a dynamically allocated class.

Member Avatar for daviddoria
0
220
Member Avatar for aishu........
Member Avatar for mugenoesis
Member Avatar for sdr001

Is insertIfNew called in the constructor? I'd suggest you make the shortest possible compilable code that demonstrates the problem. "I am having a problem" should be converted to what the problem is and where/when it occurs.

Member Avatar for daviddoria
0
161
Member Avatar for Mafiasays

What do you mean by "tests"? Can you show us your current code? Can you tell us exactly what you are starting with and what you are wanting to produce? David

Member Avatar for Mafiasays
0
386
Member Avatar for Chris11246

Those are linker errors. You have not shown your compiler commands, but you'll need a `-l something` in there somewhere. I have put several OpenCV examples here: http://programmingexamples.net/index.php?title=OpenCV They all use CMakeLists.txt files to be used with the CMake build system, so unless you switch to CMake (which I highly …

Member Avatar for rubberman
0
283
Member Avatar for skatamatic

Generally it's a good idea to abstract the problem into as simple and small piece of source code that you can rather than upload your entire project. This way when an answer is obtained, it will help others in the future as well, rather than just help the king move …

Member Avatar for robab
0
167
Member Avatar for daviddoria

I was wondering if I partially specialize a class (which I'm understanding to mean hardcode some of the template parameters?) if I have to implement all functions or if I can just implement some functions. I put together a demo: [url]http://programmingexamples.net/index.php?title=CPP/Templates/PartialClassSpecialization[/url] Where in the main class definition there are two …

Member Avatar for mike_2000_17
0
587
Member Avatar for magravis

Please use code tags when posting code. Also, try to remove any code that is not related to the problem. For example here the greeting() function is unnecessary. You will find that the shorter you can make the problem, the more likely people are to look at it :)

Member Avatar for WaltP
0
118
Member Avatar for zero44

I think [code] for (; num; num /= base) { [/code] could be written [code] for (; num != 0; num /= base) { [/code] It was using the idea of "anything non zero evaluates to true (or "continue the loop") while when it is zero the loop should stop. …

Member Avatar for daviddoria
0
102
Member Avatar for eman 22

For starters, I would suggest never using spaces in a file name :) If you insist on doing so, I think Windows likes backslashes instead of forward slashes - I don't if c++ cares about this. Also, you may need to "escape" the space with a backslash: read_file("F:/2nd\ year_2/Data structure …

Member Avatar for eman 22
0
139
Member Avatar for altXerror

You may want to take a pass through something like this: [url]http://www.cplusplus.com/doc/tutorial/[/url] to get an idea of variable types, etc.

Member Avatar for daviddoria
0
88
Member Avatar for fiberoptik147

Welcome to DaniWeb! To help us help you, here are some tips: 1) Use code tags (I see you put brackets around the code, but you need to use [code ]code goes here [/code ] (but without the space) 2) Please tell us what the program is supposed to do. …

Member Avatar for sergent
0
209
Member Avatar for v_janssens

Are you deleting the memory you are allocating with malloc? Depending on how big these matrices are, maybe you are running out of memory? Do you need to keep each of these 4000 matrices? Or just use it and then discard it?

Member Avatar for v_janssens
0
463
Member Avatar for Lusiphur

VTK (vtk.org) and ITK (itk.org) also have a lot of tools that could be useful. VTK even has a huge set of examples :) [url]http://www.vtk.org/Wiki/VTK/Examples/Cxx[/url]

Member Avatar for arisa12
0
716

The End.