1,177 Posted Topics
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 … | |
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 … | |
Re: 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 … | |
Re: [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 … | |
Re: 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? | |
Re: 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. | |
| |
Re: 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. | |
Re: Can you post a very short ( < 30 lines) piece of compilable code that demonstrates the problem? | |
Re: Here is an example of using setw: [url]http://programmingexamples.net/index.php?title=CPP/IO/Setw[/url] | |
Re: 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] … | |
Re: 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. | |
Re: 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] … | |
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 == … | |
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 … | |
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; … | |
Re: 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 | |
Re: 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 | |
Re: 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. | |
Re: 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 … | |
Re: 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 | |
Re: 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 … | |
Re: What is the problem? I'd recommend using a std::vector<std::vector<int> > . You can then resize on the fly. | |
Re: 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 … | |
Re: You may want to look into the "system" command. I don't know if it works in windows. | |
Re: That looks fine to me - doesn't this do what you want? [url]http://programmingexamples.net/index.php?title=CPP/ZeroPad[/url] | |
Re: The ifstream should automatically parse on white space. That is: [code] dataFIle >> user >> password; [/code] should do the trick. | |
Re: 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] | |
Re: 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 … | |
Re: Please fix your indentation, it is crazy! Also, we may need to see the contents of CAMERA.h | |
Re: 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 … | |
Re: 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 … | |
Re: 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 | |
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 | |
Re: 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 … | |
Re: Does this help: [url]http://programmingexamples.net/index.php?title=CPP/IO/ReadingLines[/url] ? David | |
Re: Please mark the thread as solved if you're all set. | |
Re: You'll first have to decide what kind of GUI you want. I.e. do you want to use OpenGL, etc? | |
Re: 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 | |
Re: 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] | |
Re: 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! | |
Re: 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 | |
Re: Can you explain what the problem is? What is an example input, current output, and the expected output? David | |
Re: I don't know anything about CURL, but you can use SQL through VTK: [url]http://vtk.org/Wiki/VTK/Examples/Cxx#Databases[/url] | |
Re: 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. | |
Re: 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 | |
Re: 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, … | |
Re: I think this belongs in the "Looking to hire" section: [url]http://www.daniweb.com/forums/forum72.html[/url] | |
Re: 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? |
The End.