2,045 Posted Topics
Re: Also make sure the compiler is in the path of whatever cmd console you are using. Under windows (I assume, since you have C++.exe) type "PATH = %PATH%;C:\MinGW\bin" (change the values for your system) which tacks that directory on to the existing path | |
Re: Would something like this work (if you used Visible = false in your resize method instead of Hide())? [code] private void notifyIcon1_MouseDoubleClick(object sender, MouseEventArgs e) { if(this.WindowState == FormWindowState.Minimized) this.WindowState = FormWindowState.Normal; this.Visible = true; } [/code] | |
Re: I think since the other array must track the indicies of the first it would be difficult to use the STL methods anyway. What are some of the things you have tried? | |
Re: Also, your method definitions, e.g., [code] void dayOfTheWeek::printDay() { cout << "Today is: " << day[dayNum] << endl << endl; }[COLOR="Red"];[/COLOR] [/code] and onward should not end with a semicolon after the brace (you do still need the ones at the end of your class declaration and your const array). | |
Re: *Please* use code tags. It keeps it neater and preserves your formatting so we can read the code. Make balance and bet doubles also, as what if I lost 20.50 in the process or wanted to bet $4.50? cout<<"Please enter your bet$100.00):"<<endl; //hint this line should be updated for each … | |
Re: Sounds like you need regular expressions. Here's a succinct tutorial I came across. They are toting some product or something but it has a few good examples of what you might need towards the bottom of the page. [url]http://www.radsoftware.com.au/articles/regexlearnsyntax.aspx[/url] Here's the MSDN page that gives a couple of oversimplified examples … | |
Re: I may be missing something but why do you have [icode] (const E &item) [/icode] _after_ the braces? | |
Re: Replace your [icode] cin.ignore(cin.rdbuf()->in_avail() + 1); [/icode] call with [icode] cin.ignore(); cin.get(); [/icode] the get() will wait for a keypress from the user. | |
Re: I've tested it and it seems to come out ok (against a site like [url]http://www.ohrt.com/odds/binomial.php[/url]). What trouble are you having with it? | |
Re: Using 2 datetime pickers you can get the timespan between them [code]TimeSpan ts = dateTimePicker2.Value - dateTimePicker1.Value; MessageBox.Show(ts.ToString()); [/code] To do what you're suggesting would probably take the user putting in one of them to the DTP, hitting a button to lock the value into one DateTime object, choosing a … | |
Re: [CODE]newtextbox.Text = oldtextbox.Text.Substring(12);[/CODE] The 12 accounts for the commas in the string. Substring(12) grabs all characters (including) 12 and beyond. | |
Re: [QUOTE=jonsca;1099095]When going through your loop after entering in the physician's name [code] for( i=0;i<n;i++) { cout<<"\nEnter physician "<<i+1 <<" name :"; cin>>phy_name[i]; [/code] it's trying to write the entire name to phyname[i] which [I]is[/I] only one character. Consequently the extra characters remain in the stream, writing into the next set … | |
Re: Please use the code tags if (guess < randomNumber) // If guess is < than the random number, display cout << "Your guess was too low\n\n"; if (guess > randomNumber) // If guess is > than the random number, display cout << "Your guess was too high\n\n"; You did not … | |
Re: Don't use goto. Use a loop instead. This way you can put in an exit option. When getting input like you are use a do/while loop so that you can test for whether you should exit the loop after you've gone through one cycle. Your function names leave a bit … | |
Re: A few hints: 1.) [icode] int square(int side, int i); [/icode] is a function prototype. It should not be placed in main() 2.) function parameters are used to convey information between different methods. what information is i bringing into the square() method? 3.) grab a pencil and paper and go … | |
Re: So just to clarify in your example the output should look like: [CODE]<space><space>y12-100<space> z1234-250<space><space> x1adsf-5 <space><space>y12-150<space> z1234-300 <space><space>y12-200[/CODE] this? (with width = 8) I'm just a tad confused... | |
Re: When going through your loop after entering in the physician's name [code] for( i=0;i<n;i++) { cout<<"\nEnter physician "<<i+1 <<" name :"; cin>>phy_name[i]; [/code] it's trying to write the entire name to phyname[i] which [I]is[/I] only one character. Consequently the extra characters remain in the stream, writing into the next set … | |
Re: Firstly, please learn to use code tags ` EmpRec>>Ename>>emp_rec>>no;` This is reading exactly one line from your text file and stopping. The expression you have in your while loop condition isn't actually doing anytihng. Put `mpRec>>Ename` as your while loop condition while(EmpRec >>Ename) { EmpRec >> emp_rec>>no; //you might be … | |
Re: You get a compiler error because the return type of your function is void (therefore no object to pass to cout) Since you are passing grade by pointer into the findGrade method, you should call the function first by itself, after that grade will have changed and you can output … | |
Re: Are your indicies of a type that have the ability to be directly compared? (like ints or strings)? If not you must write an IComparer<your_index_object> method and pass it into the constructor of the sorted list. Here's the MSDN for sorted list. [url]http://msdn.microsoft.com/en-us/library/system.collections.sortedlist.aspx[/url] | |
Re: I couldn't figure it out either initially but he means when you open that same Properties window but for example with a Word document. You get all those fields in that context. | |
Re: Check [URL="http://msdn.microsoft.com/en-us/library/aa394122(VS.85).aspx"]this[/URL] out(using Windows Management Instrumentation, WMI). I think it's what you are looking for but it's a Win32 API call so it involves using the P/Invoke technique (in which I am not versed). EDIT: Using that relies on [URL="http://msdn.microsoft.com/en-us/library/aa393485(VS.85).aspx"]this[/URL] which isn't implemented (??) in the WMI. Wish I could … | |
Re: Select all the items on your form (or select them in groups if you don't want the same settings for all of them). Go over and click on the properties tab under Solution Explorer (if you can't see it, go to View/Properties Window). Go to the margin setting. Change as … | |
Re: These two might be overkill for what you are seeking (but they are in C#): [url]http://www.menees.com/index.html[/url] [url]http://www.codeproject.com/KB/recipes/diffengine.aspx[/url] Do a net search on "Diff" which is the utility in *nix to do this kind of thing. I think (it's been eons since I've used it in any form) that it makes … | |
Re: [icode]if (matrix[x][y]!='you have choosen the worng letter')[/icode] What is that? ' ' surround single characters, not strings. How could your matrix value ever be equal to that? Why don't you check if it's equal to 'x'? Also: [code] if (matrix[i][0]==matrix[i][1]&&matrix[i][0]) is not doing what you think for all those if … | |
Re: Just put in a test between the end of your switch and the end of the while loop. } //end of switch case if (i == 0) break; // you need another break to get out of the while } //end of while (if you can still edit your post, … | |
Re: [quote]i meant c++ graphics..[/quote] No such thing, at least not in standard C++. What you have is a non-standard library which was created by Borland (and others). If you are still trying to use a ca. 1993 Turbo 3.X technology on a ca. 2006 operating system then you may be … | |
Re: You still have that block from 22-38 that's segregated without any reason for doing so. You're returning 0 from a function that has void type (so it shouldn't return anything) and you have a dreaded goto in your code which should only [I]possibly[/I] be used under the most dire of … | |
Re: I don't think anyone is shunning you, I think it's just a [I]highly[/I] specialized topic. I'm not in the music arena at all but I'm sure there are APIs out there, though they may be specific to whatever sound card you have and the like. It couldn't hurt to elaborate … | |
Re: Welcome. What have you tried so far? [quote]before the main() or inside the main()?? [/quote] Normally variables are declared within main and passed into methods. Variables local to a particular function are declared within the body of that function. [code] #include<iostream> void myfunc(int passedin) { int madeinfunc = 0; madeinfunc … | |
Re: Check out this great article: [url]http://ondotnet.com/pub/a/dotnet/2002/02/11/csharp_traps.html[/url] in the article: "...because finalization is nondeterministic (meaning you can’t control when the garbage collector will run)..." Dispose() can be used for any and all cleanup required but the garbage collector will gather the object and call it's destructor (thus finalizing the job). I … | |
Re: See also [URL="http://en.wikipedia.org/wiki/Taylor_series"]http://en.wikipedia.org/wiki/Taylor_series[/URL] | |
Re: See this for all the details members that are modifable in a console application (colors, positioning cursor etc) [url]http://msdn.microsoft.com/en-us/library/system.console_members(VS.80).aspx[/url] See this for a port to C# of a popular console manipulation library in C and C++ [url]http://sourceforge.net/projects/curses-sharp/[/url] It's not going to be as straightforward as designing a GUI for Windows. … | |
Re: First, make sure the files are in the same namespace. Look at the top few lines of each after the using statements to see. If that's not the problem type out the steps you followed to add the file in. EDIT: What mahmoud says may be the way to go … | |
Re: [code=c++] void searchingSimiler ( char letters[], int counts[], [B]int updatenew[],[/B] char newletter ) [/code] What is updatenew anyway? I recommend replacing it with a variable called letterarrcount (or whatever) which you pass in by reference. [icode]j < letters[j] [/icode] -- this is completely wrong -- I would use letterarrcount in … | |
Re: It's never a bad idea to know what your code is doing. However, you don't necessarily have to run it yourself to see (which you could do by making a main() method in a new .cpp file and #include "word.h"). Take a look at the overridden >> operator. Normally the … | |
Re: Delete your variables mon and tues and simply have a [icode] string dayofweek; [/icode] member Then your (non-default) constructor only has to take 1 argument a string holding the day, so e.g., dayOfTheWeek(string dotw) and within the constructor set dayofweek = dotw; Another hint, getters should "get" the value of … | |
Re: It'll be very similar to your viewAll() method. Just test for Prod_stockcount before displaying. | |
Re: [icode] The ch3 is Æ [/icode] is what printed on my system. I don't think I have any settings on for international characters so I'm not sure why it worked. In your IDE does '\u00c6' appear brownish with the syntax highlighting? | |
Re: [quote]I enter marks through textbox, which gets saved in database. [/quote] If you've stored them in the database what is stopping you from retrieving them again. Is it a database of your own design? | |
Re: For n < 4 you are getting(as you go through the loop): [code] result +=billy[0]; //billy[0] = 16, result = 16 result +=billy[1]; //billy[1] = 2, result = 18 result +=billy[2]; //result = 95 result +=billy[3]; //result = 135 [/code] What you are doing with the loop is accruing a … | |
Re: hint: on this line [icode]printf("\n\tThe binary number %s has been converted to %d decimal\n\n",i ,result); [/icode] the variable i is not a null terminated string. Also, try fgets(reference [URL="http://www.cplusplus.com/reference/clibrary/cstdio/fgets/"]here[/URL] - ignore that it's a C++ site)for your input it's much cleaner (and standard). | |
Re: It resets the indicator for whether or not the number is prime for the next cycle through the loop. Otherwise it stays false and will keep breaking out of the inner for loop instead of testing. The total number is simple just put a counter inside the [icode] if (isPrime) … | |
Re: You can use the Split() method of the string to divide it up by a set of delimiters into a string array. Then you can use the static TryParse method in any of the numeric types (e.g., Int32.TryParse(), float.TryParse(),and for double, Int16,Int64, even boolean) to get numbers from the individual … | |
Re: What are you using to indicate that the datum needs validation (e.g., button, pressing enter, etc.)? I allowed enter in the textbox, checked for the key down and it worked with the convert method. EDIT: That was a tie lol | |
Re: Missing some semicolons after lines 24 and 50. You left off the e in infile on 44 and 70. Not sure why you didn't strcpy on 26 and 27. Most vital is intializing i to 0 on line 39 (since your first trip through the loop it doesn't have any … | |
Re: Well, the real story is you never write ~~~m back to m to print it out so you're getting your old value. As for ~ it inverts the bits of an integer (bitwise not), so assuming a 32 bit integer: m = 00000000 00000000 00000000 00000001 ~m = 11111111 11111111 … | |
Re: Why not use [code] enum pInfo { pLevel, // =0 pMember, // =1 pLeader // =2 }; int PlayerInfo[MAX_PLAYERS][3]; [/code] otherwise you have all the elements in the enum = 0 so PlayerInfo[n][pLeader] would be the same as PlayerInfo[n][pLevel] (all accessing the [n][0] cell). The latter change is going along … | |
Re: Main() returns an int. Give [URL="http://www.eskimo.com/~scs/readings/voidmain.960823.html"]this[/URL] a read. You cannot use the bitshift operator with a string, the compiler states that very clearly. You could probably write your own shift function that will push a 0 onto the beginning or the end of your string. Otherwise for the built-in ones … | |
Re: (I'm not sure if this is correct, but avert your eyes if you're still working on it) ********************************************************** I think the statement in main is interpreted as a redeclaration of the function. |
The End.