2,045 Posted Topics

Member Avatar for yen chin

[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 …

Member Avatar for jonsca
0
123
Member Avatar for Ascaris

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 …

Member Avatar for Ancient Dragon
0
294
Member Avatar for tjm6f4

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 …

Member Avatar for Ketsuekiame
0
159
Member Avatar for Phinisher

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.

Member Avatar for griswolf
0
110
Member Avatar for megaLU
Member Avatar for jonsca
0
2K
Member Avatar for ThatGuy2244

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.

Member Avatar for ThatGuy2244
0
126
Member Avatar for somshridhar

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.

Member Avatar for kernel>panic
0
4K
Member Avatar for Fjolsvidr

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 …

Member Avatar for mike_2000_17
1
128
Member Avatar for flasp

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 …

Member Avatar for jonsca
0
259
Member Avatar for flasp

[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 …

Member Avatar for kri_prasad2000
0
171
Member Avatar for HelloPeople1

== 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, …

Member Avatar for jonsca
0
170
Member Avatar for tarbeux

Which part is giving you the most trouble? Please post whatever code you have tried sofar...

Member Avatar for kernel>panic
0
91
Member Avatar for nathanw

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.

Member Avatar for jonsca
0
213
Member Avatar for ram619

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.

Member Avatar for jonsca
0
79
Member Avatar for Zvjezdan23
Member Avatar for atticusr5

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.

Member Avatar for atticusr5
0
101
Member Avatar for rohan1020

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.

Member Avatar for jonsca
0
129
Member Avatar for vineeshvs

[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.

Member Avatar for vineeshvs
0
159
Member Avatar for atticusr5

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; …

Member Avatar for Fbody
0
5K
Member Avatar for vedro-compota

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.

Member Avatar for vedro-compota
0
120
Member Avatar for SolidSora

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 …

Member Avatar for Fbody
0
144
Member Avatar for Skrljutak

[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?

Member Avatar for diafol
0
376
Member Avatar for pseudorandom21

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.

Member Avatar for pseudorandom21
0
73
Member Avatar for john_zakaria

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)

Member Avatar for jonsca
0
103
Member Avatar for privs

This is a good one: [url]http://www.cplusplus.com/doc/tutorial/files/[/url]

Member Avatar for jonsca
0
210
Member Avatar for rcmango

Line 23 should be [icode] openagain >> k; [/icode] but see [url]http://www.daniweb.com/forums/post155265-18.html[/url] about using .eof()

Member Avatar for rcmango
0
97
Member Avatar for triumphost

[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 …

Member Avatar for triumphost
0
252
Member Avatar for DJSAN10
Member Avatar for DJSAN10
0
60
Member Avatar for salvador01

Hint: get the user's input in the form of a char array (use fgets to read the line of text).

Member Avatar for jonsca
0
109
Member Avatar for snipermann

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 …

Member Avatar for jonsca
0
369
Member Avatar for imolorhe

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).

Member Avatar for jonsca
0
64
Member Avatar for Snader

There is one super easy way to tell what the output is. Compile and run the program.

Member Avatar for stevanity
0
88
Member Avatar for pseudorandom21

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 …

Member Avatar for jonsca
0
312
Member Avatar for MasterGberry

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.

Member Avatar for MasterGberry
0
127
Member Avatar for Firsum

[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.

Member Avatar for jember
0
358
Member Avatar for PCSAWICK829

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.

Member Avatar for anirudh33
0
255
Member Avatar for Peter_morley
Member Avatar for justinwarner

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 …

Member Avatar for Stefano Mtangoo
0
293
Member Avatar for Narue

[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 …

Member Avatar for bumsfeld
6
256
Member Avatar for bleedi

Qualify it with the name of the TCP base class: [icode] MyTCPBaseClassName::connect() [/icode]

Member Avatar for jonsca
0
236
Member Avatar for MrJNV

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.

Member Avatar for mrnutty
0
167
Member Avatar for murtazamzk
Member Avatar for murtazamzk
0
152
Member Avatar for triumphost

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]

Member Avatar for jonsca
0
361
Member Avatar for MasterGberry

[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 "->" …

Member Avatar for MasterGberry
0
161
Member Avatar for roseworld

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 …

Member Avatar for roseworld
0
224
Member Avatar for Danny1994

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]

Member Avatar for jonsca
0
238
Member Avatar for Nick Evan

[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 …

Member Avatar for AndreRet
2
435
Member Avatar for davi0011

[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).

Member Avatar for jonsca
0
203
Member Avatar for Danny1994

[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

Member Avatar for jonsca
0
163
Member Avatar for MasterGberry

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 …

Member Avatar for MasterGberry
0
147

The End.