1,177 Posted Topics
Re: I don't even understand the output you are looking for? Can you make a list of the first 11 numbers you would like to output? | |
| |
Re: Rather than delete the thread, you should post what you figured out. This way when someone searches the forum, if they find your question they will also find the answer! | |
Re: While this is a pretty short program, I think it would still help to break it down in to functions. Some ideas for functions would be: [code] void GuessLetter(char letter); //the main logic - every user input should trigger this function bool ContainsLetter(string word, char letter); //determine if 'letter' is … | |
Dani and community, I saw this thread: [url]http://www.daniweb.com/forums/thread296478.html[/url] and it gave me an idea. With nearly 800,000 members, we should try to leverage the massive talent that has amassed on DaniWeb to collectively do some projects for some worthy causes. For example, the web design/programmers could work together to make … | |
Re: You can start another program using the system() function. As for a GUI, I would suggest Qt4. Dave | |
Re: French or not, you're going to have to show us that you have tried. We are not going to do your assignment for you, but we'd be happy to teach you something along the way! | |
Re: Try to break the problem down into as small of parts as possible. Make a < 20 line program that demonstrates one problem you have having and post it for us. It will be much easier to teach you little bits at a time using this procedure than to simply … | |
With std::queue I've been using this: [code] std::queue<int>::iterator pos = std::find( q.begin(), q.end(), 5); [/code] But when I try that with std::stack : [code] std::stack<int>::iterator pos = std::find( s.begin(), s.end(), 5); [/code] I get [code] error: ‘iterator’ is not a member of ‘std::stack<int, std::deque<int, std::allocator<int> > >’ [/code] Anyone know … | |
Re: I don't understand why current_loc even needs to be a pointer? Why not just have each player have a member object of your location enum? Maybe I missed something? | |
Re: Unless you are extremely experience I think you should leave this to the experts an use an existing virus scanning software. Dave | |
Re: What do you mean by "does not work"? What is an example triple of input? The current output? The expected output? I'd recommend making a small demo program to test the functions without any user interaction - that is, hard code three values and see if it gives you the … | |
Re: Please don't delete the question - rather post the answer in a reply so that other people searching the forum can find the solution as well. | |
Re: Please use code tags when posting code. Also, which numbers are not working correctly? You should be as detailed as possible when posting your problems so people here can help you as efficiently as possible. David | |
Re: I use VTK for everything 3D (vtk.org). You ask for c++ and VB in the same sentence though - which would you prefer? | |
Re: Welcome to DaniWeb! It would really help if you could "abstract" the problem that you are having. That is, try to make a <20 line compilable example that demonstrates the problem. It is much easier for us to teach you something that you can then apply to your large program … | |
Re: My suggestion (same as Mike's) is to convert everything to a CMakeLists.txt file. It will take some initial time, but it will make everything MUCH easier. | |
Re: By 2D vectors I think he means [code] std::vector<std::vector<double> >[/code]. Also, is this for an assignment? If not, you should definitely stick with a matrix class that is already made - vnl_matrix from the VXL package or something like that. It will save you lots of headaches. Dave | |
Re: try [code] g++ yourfile.cpp [/code] This will produce a binary called a.out. You can also do this to specify the name of the binary file: [code] g++ yourfile.cpp -o nameOfBinary [/code] | |
Re: You should read a line at a time and use this: [url]http://programmingexamples.net/index.php?title=CPP/Strings/Split[/url] You should have a Data class and overload the input operator to handle parsing the dates (with the /'s etc) | |
Re: I got really annoyed with the "low-level-ness" of OpenGL and GLUT. SDL provided what I thought was a much more reasonable level of an interface. It was also nice that you don't have to enter the "glut main loop" so you don't have to change your existing code so much … | |
Re: Can you please clarify? You want to have a prompt such as : "Enter the password: " and then check if the password that is entered is correct? Depending on the security level needed, you could just hardcode the password in the code and do a string comparison. Another common … | |
Currently I am pointing my domain (mydomain.com) somewhere by using this as the index.html: [code] <html> <head> <meta HTTP-EQUIV="REFRESH" content="0; url=http://somewhere.com"> </head> <body> </body> </html> [/code] However, when I go to mydomain.com, it redirects to somewhere.com, but the URL is actually changed to "somewhere.com" in the browser. Is there a … ![]() | |
Re: Search this page: [url]http://en.wikipedia.org/wiki/C%2B%2B[/url] In the future, there is really no need to start 3 threads for these things. | |
Re: First, please use a descriptive title. "Help me" does not qualify! Second, you posted this only 2 hours before. Did you really expect help in that short of time? Most importantly, why would we do your assignment if you don't want to. It looks like you have simply copied and … | |
Re: After you input the Fahrenheit temperature, you immediately call calcCelsius which contains a cin statement. If you type a second number and hit "enter" again it works. It doesn't really make sense to input the Celsius temperature though in calcCelcius, right? | |
Re: It is not reasonable to translate a sentence into another language one word at a time. Assuming you want this "bad" translation (word by word), you should split the sentence at the spaces and store the words in a std::vector<std::string> and iterate through the vector to do the translation. | |
Re: The problem is that in this line: TicTacToe game(char X, char E); You cannot have the type again - it needs to be: TicTacToe game(X, E); However, now you will get a "X is not declared" error. You either need to make X public and use game.X or do something … | |
Re: Welcome to DaniWeb! You won't likely get any help here unless you show us that you have given it a good try yourself first. Post some code that you have come up with and explain the input, current output, and expected output along with any compiler errors or crashes and … | |
Re: I think you could use the min histogram value from this function: [url]http://opencv.willowgarage.com/documentation/python/histograms.html#getminmaxhistvalue[/url] ? That kind of seems silly, but I don't see any obvious easier "ImageMinValue" type of type of function that they provide. | |
Re: You could certainly do what firstPerson has suggested. Or you could just generate independent random numbers: [url]http://programmingexamples.net/index.php?title=CPP/RandomNumbers[/url] | |
Re: Take a look at this: [url]http://programmingexamples.net/index.php?title=CPP/Strings/CountCharacters[/url] Dave | |
Re: '' is typically called an "escape sequence". If you are actually trying to search for a '', you need to use a '\'. Can you explain an input that is giving you an incorrect behavior? | |
Re: I'm not exactly sure what the problem is. Does it crash? Or what is the input, current output, and expected output? Dave | |
Re: Please use code tags when you post code. Also, DaniWeb has a "Looking to Hire" forum that you should post something like this "willing to pay..." post in. Dave | |
Re: Please try to simplify your problem down to a < 20 line piece of code. Then also explain the problem in much more detail. You'll find that it is highly likely that no one will help you in the current form that you have posed your question. Dave | |
Re: Welcome to DaniWeb. Please refrain from typing in all caps. You can install any linux distribution on any computer and you will have the g++ compiler to compile and test your code. Dave | |
Re: Is there any reason why it must be done in c++? I'm also assuming he is using Microsoft Windows? Dave | |
Re: You can also check out [url]http://programmingexamples.net/[/url] | |
Re: jeffpro, Welcome to DaniWeb! SetCursorPos() seems reasonable, too bad you can't use it! Which operating system are you using? That is definitely going to dictate how you need to go about this. Dave | |
Re: Welcome to DaniWeb! Please use code tags when posting code. It makes it much more readable for us. The first step would be to convert to lowercase. You can use this method: [url]http://programmingexamples.net/index.php?title=CPP/Strings/Case_Conversion[/url] Then take a look at this example. It shows how to count the occurrences of a character: … | |
Re: Here are a couple of things: 1) If you want to be a bit adventurous, I've heard of the concept of "labeling" threads (as gmail does) rather than putting them in subforums (folders, following the gmail vs traditional email example). I noticed your thread discussing how you re-arranged some subforums … | |
Re: If the lists are small, I would copy each of them into an std::multiset. The set will be sorted automatically. You can then compare each element of the sets. If they all match, the original string you have are equal. Maybe someone has a better (more efficient) idea for you? … | |
Re: Hi duude, Welcome to DaniWeb! It may be painful to install and get working the first time, but Boost has a timer: [url]http://programmingexamples.net/index.php?title=CPP/Boost/Timer[/url] Good luck, Dave | |
Re: Hi Coronax, Welcome to DaniWeb! Even though you are coding in c++, this is not really a c++ question. I would check with a math-y forum such as mathoverflow.net, the Mathworks forum, or physicsforum.com to see if you can get a good explanation. Good luck! Dave | |
Re: The dinner was great! It's always interesting to have conversations with people from such varying backgrounds. The pictures look great, too! What was the deal with the glasses with no lenses? I saw Dani had them on for a while, then they disappeared. Unfortunately I couldn't stick around for much … | |
Re: Can you explain the problem that you are having? If you have a specific problem, if you could trim the code down to < 20 compliable lines that demonstrates the problem, that would me much easier for us to look at than just dumping 200 lines on us! Dave | |
Re: You should definitely use a std::vector<int> to store these things. You could also then define an enum to contain the name of the years to access the correct element of the vector JANUARY = 0, etc Good luck, Dave | |
Re: That is really a better a question for here: [url]http://sourceforge.net/projects/notepad-plus/forums[/url] Dave |
The End.