1,177 Posted Topics

Member Avatar for daviddoria

I have a folder A with files 001.jpg, 002.jpg, etc I also have a folder B with different files but with the same names; 001.jpg, 002.jpg, etc I want to put all the files in the same directory - is there something that will automatically rename them or something so …

Member Avatar for MaroBey
0
170
Member Avatar for daviddoria

After reading some tutorials it looks like this is how to embed a video with html5: [code] <html> <body> <video width="560" height="340" controls> <source src="big_buck_bunny.mp4" type='video/mp4; codecs="avc1.42E01E, mp4a.40.2"'> </video> </body> </html> [/code] (That video is in the same directory has the .html file) When I do this, I see the …

Member Avatar for hindlist
0
92
Member Avatar for aaronmk2

I think descriptive variable names and comments would be helpful here (and everywhere... :) ) I'm assuming 'tall' is the height? If so, name it 'height' and change the name of the function to GetHeight() or something like that. What is 'tall1'? Add a comment to at least every conditional …

Member Avatar for mrnutty
0
246
Member Avatar for watery87

[QUOTE]My trouble is with the first book title input. It prints out both booktitle and date published on the same line. It doesnt happen for the rest of the titles though.[/QUOTE] For questions like this, I would attempt to narrow down the problem as far as possible. That is, rather …

Member Avatar for Unimportant
0
190
Member Avatar for Anuradha Mandal

Here are some examples of simple operations using std::list : [url]http://programmingexamples.net/index.php?title=CPP/STL/List[/url] As for making a student database - I'm assuming you just want to make a [icode]class Student[/icode] and then store the students in a list?

Member Avatar for daviddoria
0
255
Member Avatar for aviles

I'd suggest printing the sum at each iteration of the loop to see what is happening. If you can't get it, post code without any user input that produces a result that you are not expecting.

Member Avatar for sfuo
0
180
Member Avatar for yesamin
Member Avatar for burcin erek

There should be a file probably called msoftcon.cpp that you need to include in your project. These functions are not defined in the file you have posted, so you can't use them unless you link to the file that defines them.

Member Avatar for burcin erek
0
523
Member Avatar for cchase36

Can you post a very short ( < 30 lines) piece of compilable code that demonstrates the problem?

Member Avatar for mrnutty
0
49
Member Avatar for mitrious

Here is an example of using setw: [url]http://programmingexamples.net/index.php?title=CPP/IO/Setw[/url]

Member Avatar for daviddoria
0
149
Member Avatar for brontok214

I don't see why you'd need pointers here, but you definitely should use a loop: [code] for(unsigned int i = 0; i < amount.size(); i++) // note you can only use .size() if you use an std::vector, which you should definitely consider! { amount[i] = price[i] * quantity[i]; } [/code] …

Member Avatar for daviddoria
0
250
Member Avatar for mtron10
Member Avatar for edubar

Please use code tags. It really helps readability. You'd have to have an instance of Robot in the Motores class in order to call that function.

Member Avatar for daviddoria
0
174
Member Avatar for timb89

You haven't shown us the code where the problems are occurring. It should be easy to spot a "too many arguments" type of problem. Have you included <stack> ? That is the only reason I would say push() would not be defined. Here is an example of using stack: [url]http://programmingexamples.net/index.php?title=CPP/STL/Stack[/url] …

Member Avatar for daviddoria
0
100
Member Avatar for daviddoria

In the past when I've done this: [code] int function(int a) { if(a == 2) { return true; } else { return false; } } [/code] the compiler has complained that the function may not return a value. I've fixed this by adding: [code] int function(int a) { if(a == …

Member Avatar for mrnutty
0
220
Member Avatar for daviddoria

I just learned about heaps today. It looks like STL wants you to create a heap by first creating a vector, then using make_heap from <algorithm>: [code] std::vector<SimpleClass> Numbers(8); // ... populate ... // convert Numbers into a heap make_heap(Numbers.begin(), Numbers.end()) ; [/code] Why is there not a <heap> just …

Member Avatar for Narue
0
106
Member Avatar for daviddoria

Can anyone explain why the last line works? It seems like it is trying to cast a CRectangle as a CTriangle (which I imagine should fail?) but it outputs "5" as the function should. [code] // virtual members #include <iostream> using namespace std; class CPolygon { protected: int width, height; …

Member Avatar for mitrmkar
0
118
Member Avatar for sniper6560

If you are interested in comparisons, Boost has Bessel functions: [url]http://live.boost.org/doc/libs/1_37_0/libs/math/doc/sf_and_dist/html/math_toolkit/special/bessel/bessel.html[/url] [url]http://www.boost.org/doc/libs/1_35_0/libs/math/doc/sf_and_dist/html/math_toolkit/special/bessel/bessel_over.html[/url] Dave

Member Avatar for sniper6560
0
2K
Member Avatar for kazkikay12

Guys, guys, let's try to use real English words please! The title "Help plsssssssssss", the lack of capitalization, the "help plss" and "ur probelm wil b solve" make the forum look very unprofessional! David

Member Avatar for daviddoria
0
83
Member Avatar for shabir_24
Re: QT

This will show you how to iterate through an std::list. I don't know about qtlist - if you can send a link to the documentation or something maybe someone can help if you have trouble with that part.

Member Avatar for Banfa
0
122
Member Avatar for alexchen

I didn't see this post before responding in your other post. I'd recommend using a std::vector<std::vector<int> > . You can then resize on the fly. (not tested... just a guideline) [code] void msize(int Height,int Width, std::vector<std::vector<int> > map) { map.resize(width); // you'll have to pick if the outer vector or …

Member Avatar for daviddoria
0
174
Member Avatar for madhub2v

madhub2v, Welcome to DaniWeb! Can you please be more specific with your question? Which operating system are you using? Which GUI system are you planning to use? What exactly are you trying to do? Dave

Member Avatar for daviddoria
0
136
Member Avatar for notmasteryet

Naming the variables the letter names doesn't really help anything. I would create a vector of pairs: std::vector<std::pair<char, int> > or something like that to keep the letters attached to their current value. I don't know what you're doing with all of the multiplying by 4 and modding by 10 …

Member Avatar for Lerner
0
285
Member Avatar for alexchen

What is the problem? I'd recommend using a std::vector<std::vector<int> > . You can then resize on the fly.

Member Avatar for daviddoria
0
81
Member Avatar for Alochai

A few comments: 1) You should handle all of the user input directly in main and then pass values to the functions (rather than call the functions with no arguments and do the input inside as you have done). 2) Rather than have a conversion from each type to every …

Member Avatar for Alochai
0
1K
Member Avatar for manykanta

You may want to look into the "system" command. I don't know if it works in windows.

Member Avatar for daviddoria
0
43
Member Avatar for Exercitus

That looks fine to me - doesn't this do what you want? [url]http://programmingexamples.net/index.php?title=CPP/ZeroPad[/url]

Member Avatar for daviddoria
0
420
Member Avatar for acerious

The ifstream should automatically parse on white space. That is: [code] dataFIle >> user >> password; [/code] should do the trick.

Member Avatar for acerious
1
3K
Member Avatar for martin_anastaso

I think it is because your declaration does not take the variables by reference. Try changing [code] void reshuffle (std::string::size_type,std::string::size_type,std::string); [/code] to [code] void reshuffle (std::string::size_type&,std::string::size_type&,std::string&); [/code]

Member Avatar for martin_anastaso
0
208
Member Avatar for alcx88

This is pretty much c not c++. You could post in the C forum, or you could use c++. Also, please do not post line numbers in your code, the code tag adds the line numbers for you. Defines: [code] #define MAX 100 [/code] should be replaced with [code] unsigned …

Member Avatar for chiwawa10
0
96
Member Avatar for LevyDee

Please fix your indentation, it is crazy! Also, we may need to see the contents of CAMERA.h

Member Avatar for LevyDee
0
110
Member Avatar for nirali7

You have declared tokens as a pointer to a vector: [code] std::vector<char*>* tokens [/code] But are then trying to access the size() function as if it is an object (with the '.' operator): [code] tokens.size() [/code] You need to instead use the -> operator: [code] tokens->size() [/code] You also have …

Member Avatar for nirali7
0
3K
Member Avatar for pa_bruce_fan

1) Please use code tags when posting code - it makes it much easier for us to read. 2) I suggest you "break out" the problem. That is, create a new program that sets up some hard coded values and tries to do the computation. You should then have only …

Member Avatar for daviddoria
0
107
Member Avatar for rtdunlap

You need to put single quotes around the letters Change [icode]if (ch1 == a) [/icode] to [icode]if (ch1 == 'a') [/icode] You should also [icode]return 0;[/icode] at the end of main(). You should also have an [icode]else[/icode] statement to help catch things like this :) Hope that helps, David

Member Avatar for LordNemrod
0
123
Member Avatar for daviddoria

Can anyone explain why this would fail: [code] assert(cap >= 0); [/code] But this passes? [code] if(cap < 0) { exit(-1); } [/code] That is, the assert is triggered, but if I replace it with conditional, the exit() function is never called. Thoughts? Thanks, David

Member Avatar for daviddoria
0
88
Member Avatar for aikiart

I really suggest abstracting the problem. Rather than posting 300 lines of code, 290 of which have nothing to do with the operator you are trying to overload, you should be able to make a <20 line program that overload the operator. If doing that alone doesn't help you solve …

Member Avatar for aikiart
0
186
Member Avatar for XodoX
Member Avatar for XodoX
0
196
Member Avatar for LuciaP
Member Avatar for sudoku43

You'll first have to decide what kind of GUI you want. I.e. do you want to use OpenGL, etc?

Member Avatar for daviddoria
0
104
Member Avatar for ssagard

You're going to have to provide much more detail. Also, if this is a class assignment, you're going to have to show us you tried hard before asking for help. David

Member Avatar for ssagard1
0
84
Member Avatar for koolman123

GLUT is a layer on top of OpenGL - [url]http://www.opengl.org/resources/libraries/glut/[/url] If you just want to post code an don't have a question about it, I'd put it here: [url]http://www.daniweb.com/code/forum8.html[/url]

Member Avatar for daviddoria
0
124
Member Avatar for xLeonex

Please use code tags when you post code. Also, please include the compiler output. "It said something is wrong" is pretty hard for us to debug!

Member Avatar for xLeonex
0
118
Member Avatar for udtohan_noriel

Just store the words in a [icode]std::vector<std::string>[/icode] and then output the appropriate word with [icode]std::cout << words[i];[/icode]. You could alternatively use a [icode]switch[/icode] statement. In the future, please use more descriptive thread titles! David

Member Avatar for Duki
0
318
Member Avatar for cpeepee

Can you explain what the problem is? What is an example input, current output, and the expected output? David

Member Avatar for cpeepee
0
154
Member Avatar for ataomega

I don't know anything about CURL, but you can use SQL through VTK: [url]http://vtk.org/Wiki/VTK/Examples/Cxx#Databases[/url]

Member Avatar for ataomega
0
840
Member Avatar for senthamizh

That code doesn't compile for me. 'receive' is a member variable of 'bank' and you're not addressing it as such. You also need a semicolon after the class definition.

Member Avatar for dusktreader
0
147
Member Avatar for Ritesht93

Please make your thread titles more descriptive! Please use real English words (e.g. 'you' instead of 'u'). I'm not a Windows guy, but when your IDE produces a 'win32 app' I believe it is just including "windows.h" and the like so you can do some basic GUI stuff. David

Member Avatar for daviddoria
0
62
Member Avatar for VasquezPL

You should read every line like this: [url]http://programmingexamples.net/index.php?title=CPP/IO/ReadingLines[/url] Then you can use the "SplitOnDelim" idea from here: [url]http://programmingexamples.net/index.php?title=CPP/Strings/Split[/url] (either once, or twice). If you store everything in a [icode]std::vector<std::string>[/icode] it should be really easy to do something specific to the first element and something different to the rest. Good luck, …

Member Avatar for VasquezPL
0
170
Member Avatar for jonsan32

I think this belongs in the "Looking to hire" section: [url]http://www.daniweb.com/forums/forum72.html[/url]

Member Avatar for jonsan32
0
136
Member Avatar for noobuser

Since the solutions will not all have the same number of coins, I recommend you use a [icode]std::vector<std::vector<int> >[/icode]. Can you enumerate an example input, the current output, and the expected output for us?

Member Avatar for daviddoria
0
116

The End.