2,045 Posted Topics
Re: [quote]Recently, I am doing [B]my thesis [/B] project [/quote] I'm sure your supervising professor said, just throw it up on the web and turn in whatever comes back... For someone to begin to help you with this, you need to bring your existing code to the table. No one is … | |
Re: NULL is not the right thing to be testing for, you want to test for '\0' instead. seanbp is right, you want a space character, which is ' ' (single quotes) However, in one of the cases you need to check to make sure the character is not equal to … | |
Re: Put your comboboxes into a groupbox. Give each of your comboboxes a unique label in the Tag property ("CB1", "CB2" etc is what I used). Make a single SelectedIndexChanged method and hook it up to all of your comboboxes (in the Form1.Designer.Cs file), so treat it as if you had … | |
Re: Check out [url]http://www.cplusplus.com/reference/iostream/istream/seekg/[/url] seekg. Do you have to make 3 separate functions? You could definitely do it all in one pass. | |
Re: Where do you typedef it to LD? or is that just an abbreviation when you posted? | |
Re: Is this [url]http://www.codeproject.com/KB/cpp/DoubleBuffering.aspx[/url] something like what you are looking for? (I don't know much more than the term itself). I'm not sure the answer to your second question. | |
Re: cin.get() buys you a nice portable solution to the "pause" issue. Sometimes a cin.ignore() is required beforehand to clean up junk in the stream. | |
![]() | Re: I would invest in a good book like Koenig and Moo's Accelerated C++ (among others). Books like this take the approach of teaching C++ from the ground up, starting you out with C++ (and the standard libraries) rather than techniques drawn from C. The idea of learning C first is … |
Re: Where did the number 100 come from in the first place? Your best bet is a do/while loop. If the number is not zero, the while condition will be true, and the program will loop again. Putting it in the do/while form guarantees that the program will prompt for the … | |
Re: [code] for (int i = 0;i<10;i++) { std::cout << i; //works } std::cout << i; //who?? doesn't work, i is destroyed once the loop ends. [/code] [code] int i = 0; for(;i<10;i++) { std::cout << i; //works } std::cout<< i; //also works [/code] Anytime you open up braces it's a … | |
Re: == is used to test for equality, = is an assignment operator, also else doesn't take a condition, so it would just be: [code] if(PlayerTurn == true) //etc. else //etc. [/code] In fact, you could write it: [code] if(PlayerTurn) //etc. else //etc. [/code] because it's already a boolean variable. Also, … | |
Re: Which part is giving you the most trouble? Please post whatever code you have tried sofar... | |
Re: You're missing a semicolon after [icode] using namespace std; [/icode] If that's just a typo, look in stdAfx.h to make sure you aren't missing a semicolon in there instead. | |
Re: I think that it gives that error message when you try to run a project that's not compiled. Click the little hammer icon or select build from the menu. Failing that, reinstall like griswolf is saying. | |
Re: Count your braces, you never closed the switch block off. | |
Re: You need to [icode] #include <string> [/icode] but more importantly, you must pull line 80 out of the scope of the if -- since it's declared within the braces, it goes out of scope when that block ends. Move it to line 72 or before. | |
Re: You're going to need a library, there are no standard C++ methods for this. See [url]http://www.mega-nerd.com/libsndfile/[/url] I have never used it, but I'm willing to bet that a few people around here have. | |
Re: [quote]You need to explicitly cast the return-type to int ** , like int **m = (int **)malloc(r*sizeof(int *)); [/quote] I think this is only necessary in C++, in C there is an implicit conversion. | |
Re: What does one line of the data file look like? Somewhere you're trying to read something that doesn't match the type you have specified for it. Just as an example, I know this is probably not the situation you're experiencing: [code] file: 1 pw 30.0 2.0 int i; int j; … | |
Re: Yes there is. It's a class, not a namespace, so you have to qualify the calls to the static methods with Math, e.g.,[icode] Math.abs() [/icode] or whatever. | |
Re: What is the filename of the first listing of code? It should probably be something like seat.h. Then you can change line 4 of the second listing to [icode]#include "seat.h" [/icode] I understand what you were trying to do, but the < > signify to the compiler that you want … | |
Re: [quote]the security will not be an issue [/quote] I'm no expert on the topic, so this is just a thought, but what happens if one of your trusted users has a weak password and the account is compromised? ![]() | |
Re: See [url]http://support.microsoft.com/kb/955938[/url] (change your button Click() event to a MouseClick() event). You still get the "flash" on the button if the user hits spacebar, but it doesn't do anything. | |
Re: This is probably what you are looking for: [url]http://msdn.microsoft.com/en-us/library/system.windows.forms.notifyicon.aspx[/url] (specifically the balloon tip portion and the balloon tip clicked event) | |
Re: This is a good one: [url]http://www.cplusplus.com/doc/tutorial/files/[/url] | |
Re: Line 23 should be [icode] openagain >> k; [/icode] but see [url]http://www.daniweb.com/forums/post155265-18.html[/url] about using .eof() | |
Re: [QUOTE=Akill10]It is also incredible how you manage to write 4000 lines of code and have a problem like this. Did you not test your program as you went along?[/QUOTE] Agreed. Also, as I suggested with your other difficulty, make a "toy" program that contains only the 2 textboxes and see … | |
Re: Hint: get the user's input in the form of a char array (use fgets to read the line of text). | |
Re: Read a line in the file into a std::string with getline() and then parse that string with a stringstream. I'm not sure it's the most efficient way to do it, but to start, break it in half on the space, then read the halves up until ':' and throw that … | |
Re: Are they std::strings? You can use the string's find method ([url]http://www.cplusplus.com/reference/string/string/find/[/url]) to locate the string "\n\n" (using multiple calls to it, noting the position at which you last found it as the beginning of the next search). | |
Re: There is one super easy way to tell what the output is. Compile and run the program. | |
Re: Here's a good (but not great reference/tutorial) [url]http://www.functionx.com/vccli/index.htm[/url] If you know what you need MSDN is the best place to find class definitions, etc. The beauty (or some would say the bane) of .NET is that you don't have to do anything when the user clicks the X, all of … | |
Re: The size of an array must be a constant known at compile time. You should dynamically allocate it [icode] char * fileTemp = new char[fileTempsize];[/icode] instead. Some compilers are able to do what you tried to do, but it's an extension and is non-standard. | |
Re: [quote]There's nothing wrong with your codes. What's wrong with "Go To"?[/quote] Nothing, if it's used very judiciously, but it's awfully easy for it to make source code into a mess of spaghetti that's difficult to follow. Code readability is important. | |
Re: How are you getting your code from Vim to the IDE? (in other words are you opening a project for it..or?) If you're writing in Vim, you could just possibly skip the IDE and compile right from the command line. | |
Re: I'm going to be the dissenter and say take biology. While bioinformatics isn't at the same level of popularity that it once was during the big push of the human genome project, there's still a lot of work to be done there. Of course, if you know you have no … | |
Re: [QUOTE=Agni] I also think that Jonsca's an interesting person but his description will come later ..[/QUOTE] I just ran across this... I'm touched (okay, I'll delay that until after you write something). This is what I imagine WaltP's basement to look like: (only it's an operating system built on Bliss … | |
Re: Qualify it with the name of the TCP base class: [icode] MyTCPBaseClassName::connect() [/icode] | |
Re: Either read it in as a string and access the digits as characters, or get the remainders after division by 10, subtract remainder, division by 100, etc. Please post your attempt and someone will look it over. | |
Re: ...and what's the question? This looks like C (albeit non-standard) to me. | |
Re: You want something along these lines [code] int tb1value; Int32::TryParse(textBox1->Text,tb1value); //enclose this in an if to make your own error handling int tb2value = tb1value+comboBox1->SelectedIndex+12; //it doesn't matter what's in the box, just use the offset textBox2->Text = tb2value.ToString(); [/code] | |
Re: [quote=mike_2000_17] For the rest I have absolutely no idea. In fact, you didn't mention from which language you are translating this code. In what programming language is the code you posted? I cannot tell and have no idea what the "=>" syntax is supposed to mean (maybe equivalent to "->" … | |
Re: Did you try Googling? There's plenty of code out there for this type of thing. One example, with a nice webpage to explain it. [url]http://webdocs.cs.ualberta.ca/~lindek/hmm.htm[/url] That gives you the HMM part and you can get the camera code from OpenCV (I haven't looked under the hood of that library quite … | |
Re: You could write out the color as plain text and use a switch statement to get the color back again. -or- For an object, you need to serialize/deserialize it from a binary file (since you can't write out your color object itself as text). See [url]http://msdn.microsoft.com/en-us/library/system.runtime.serialization.formatters.binary.binaryformatter(v=VS.100).aspx[/url] | |
Re: [QUOTE=Nick Evan] a nice green blocky of +rep [/QUOTE] I miss the green blockies... I said this in A51 but it's worth mentioning again that I have yet to encounter any of this nefariousness, so yizzles are doing a kick-azz job with it. Anytime I've spotted anything on the activity … | |
Re: [code] gets(path1); [/code] You can overrun your buffer with gets. Use fgets instead (or you can use cin.getline if you want to use the C++ standard library). | |
Re: [QUOTE=Ancient Dragon] KeyChar is not a member of KeyEventArgs. Do you mean [URL="http://msdn.microsoft.com/en-us/library/system.windows.forms.keyeventargs.keycode.aspx"]KeyCode[/URL]?[/QUOTE] I thought the same thing, but for the _KeyPress event the second parameter of the method is a KeyPressEventArgs (which has the KeyChar member) instead of a KeyEventArgs | |
Re: Usually anything with Try in front of it in C# checks to see if the retrieval/conversion/etc. is valid so you can use the call in an if statement. Since the bool is returned, the value is returned by reference in the second parameter (C# has the designation of "out" to … |
The End.