2,045 Posted Topics
Re: Your distance is not being shown on the screen because you don't include it in the cout statment. An extra newline character in your text file is the culprit. Put the cursor at the end of the last line and hit delete (not backspace). I had thought that it was … | |
| |
Re: You need to turn your struct into a managed one, otherwise you'll have to marshal it back and forth and that will give you a headache (if you have to do it per requirement search for the class Marshal on MSDN). So something like: [code] value struct cal { String^ … | |
Re: Changing the -1 to a -1.0 should do the trick. There is no overload of that function that takes an integer for the first argument. | |
Re: I think what you need is a static method within Program to write out some text on demand. [code] class Program { static void Main(string[] args) { Display(); //display your outside message Store(); //display your store's wares LeaveStore(); //up to you to implement Display(); //display outside message again } public … | |
Re: @David I understand your desire to help, but is it necessary to bump 6-8 arguably "junk" threads in a row from 20 days ago when there is a 99% chance that the OP is long gone?? | |
Re: Rearrange it like this: [code] array<char> ^ sum = gcnew array<char>(text1->Length); //you may have missed the ^ above //in the loop { sum[i] = a; } ///// String ^ textout; for(int i = 0;i<text1->Length;i++) textout += sum[i]+ " "; TxtSum->Text = textout; [/code] When not specified the ToString() method of … | |
Re: Change [icode]i=0[/icode] on line 37 to [icode]i>=0[/icode] (i=0 resolves to false so your loop condition is false and the for loop is skipped) Also, what's the index of the last element of your string ([icode] reverse1.size()[/icode] would go one past the end)? | |
Re: [quote] I am not sure if that made any sense.. [/quote] Not really, unfortunately. Give us a few of the categories you could place it into and then we might have a better idea. [quote]It sounds like a Morse code program. [/quote] Not a bad response. Judges? | |
Re: Thanks for elaborating on your question. You need to step back from this and consider the design aspects. Deck should contain an array of card objects. In the constructor for deck you can simply use a loop to deal the cards into your deck (since you are going to shuffle … | |
Re: [URL="http://www.exploringbinary.com/how-to-install-and-run-gmp-on-windows-using-mpir/"]This is a great tutorial[/URL] on how to do it with MPIR which I believe has identical syntax, and using VS (the author of that blog posts here sometimes, I believe). If you want to compile it using MinGW you probably need to have something like MSYS or Cygwin (can't … | |
Re: I understand what you are getting at. I agree that sometimes people dump off yards and yards of code when it's not always necessary. However, I think asking for the smallest and yet compilable code can bring about a Heisenberg-like effect. The more the OP takes out the trickier it … | |
Re: Grab the .h and the associated .cpp file from here [url]http://mathbits.com/mathbits/compsci/download.htm[/url]. Make the .cpp file a part of your project. Google is your friend... ![]() | |
Re: Because of how the ArrayList stores objects (as objects of type Object ^) you need to cast your ArrayList member before it will give up it's public properties and methods. [code] ReturnString = (static_cast<PulldownArray^>(PulldownTABLE[0]))->Description; //Consider the List instead, no need to cast List<PulldownArray^> ^ pdtl = gcnew List<PulldownArray^>(); String ^ … | |
Re: I just responded to your other post (I had figured you had marked it as solved and changed your mind, I didn't know you had started a new one) with a concern about your aver_h in your AverHigh function. | |
Re: You set countdown = 5 and when it hits the for loop, the condition is already false (5<5) so it skips the loop completely. EDIT: Beaten by a hair ^^^^^^^ P.S. Kicking up the warning level on your compiler (so using a -Wall switch with g++ or a /W4 with … | |
Re: [QUOTE=jwenting;1210711]And the money machine is already working. There's going to be a "new" version released soon, which will be identical except it's 6 minutes longer. And no doubt the crowds will once again flock to the cinemas and DVD stores to buy that one too even though they already have … | |
Re: Can you ballpark a region where it crashes? If you have a debugger see where it crashes or put in some cout statements in strategic spots to note the progress. Then I (or someone else) can take a look at that specific spot. | |
Re: You are missing the datatype for [iCODE]m_t[][/iCODE] in your function definition. You are passing [iCODE]m[t][/iCODE] into your functions in [iCODE]main()[/iCODE] improperly, you do not need the []. Take a look at line 51 versus other times you have used a 2D array. If you want to keep [iCODE]m_t[/iCODE] as 1D … | |
Re: <Delete> Sorry I was looking at the dimensions of the wrong array. Discussion seems to be continuing at the OP's other thread on this. | |
Re: Keep a counter when you are reading in each of the files and use that number to dynamically allocate the array (using new). | |
Re: I know zero about SDL but do you have all of the directories set up properly? The includes go under the Project/"YourProject"Properties/ConfigurationProperties/C-C++/AdditonalIncludeDirectories You'll also need to put the libs directories under the Linker/AdditionalLibraryDirectories of that same Config Properties menu (and the names of the libs under the Linker/Input/AdditionalDependencies)) | |
Re: [quote]System.Drawing[/quote] The ones with the periods are the C# libraries System::Drawing is correct. Can you post your point.h? If it is an unmanaged class (i.e. is not a ref or value class) you will probably not be able to incorporate the managed code (the .NET Color portion) with the unmanaged … | |
Re: [quote] WTF [/quote] Read the comment. He had tacked this onto another thread. It was assessed in that thread and after that it was split off by a moderator. | |
Re: You need to implement a ToString() method in your gun class (or any other that you want to display). You can declare it inline in the public section of the header for your class: [code] virtual String ^ ToString() override { return name; } [/code] change name to whatever member … | |
Re: Include "Form2.h" (change to the appropriate name in your code). Create a load method for Form1 and put [code] Form2 ^ form2 = gcnew Form2(); form2->Show(); [/code] | |
Re: I think there's some confusion in terminology is all. I believe when the OP said "template main" he literally meant code his instructor had given him to use as a model to follow (not in the sense of generic programming). Did you get this resolved, OP, after that detour? The … | |
Re: [QUOTE=chary8088;1186603][CODE] srand(time(NULL)); //seed int lino = rand(); //rand number [/CODE][/QUOTE] To use these functions you must [icode] #include <cstdlib> [/icode] | |
Re: Make table a private member of your class. Use a "setter" method that takes in the value, applies the hash function and puts it in the proper cell of the array. ADs point is valid and important as not all inputs to your hash function will hash uniquely, causing collisions … | |
Re: Save the Excel file out as a CSV file and read it in like any other text file (with ifstream, etc.). | |
Re: Try looking [URL="http://www.daniweb.com/forums/announcement8-2.html"]here[/URL] | |
Re: Simply pass the array in as [icode] matrix [/icode] each time without any of the brackets. You've already designated that the function is taking an argument that's a matrix with 2 dimensions in the prototype and definition. When it comes to the definition of the function, the array being passed … | |
Re: Use your >> statement to drive the loop: [code] while(weightcategory<7 && charge >>shippingcharges[weightcategory][0]); [/code] (since it's a one line statement put the ; after it, but if there's a body to the while don't put that one in) That avoids having to use the eof at all, which can cause … | |
Re: What are the errors? Find the first one and fix it and many of the later ones will fall away... | |
Re: Could you post the complete code? The error is not apparent from what you have posted. | |
Re: In order to print something using a cout statement your function must return something (a string, int, double, etc). Your print() method is void. Just call your print method on its own without sending it into cout. | |
Re: Find the coordinates of the center of the screen and add that to your current point. So if the center was at 50,50 and you had a point at 10,10 it would now be at 60,60 in your coordinate system. I don't know much if anything about the graphics.h system … | |
Re: [QUOTE=Salem;1192158]I was thinking of creating my own rival search engine and calling it "[URL="http://en.wikipedia.org/wiki/Bing_Crosby"]Crosby[/URL]" ;)[/QUOTE] I would see your unrelated Crosby entity and raise you Stills and Nash (and maybe even Young). I keep wondering when Bing is going to start making decisions for me -- it's supposed to tell … | |
Re: I never seem to have any soda ash around the house when I really need some though.... Also, is there a microwave version? | |
Re: [quote] some wire strippers [/quote] I believe the term "dancer" is preferred nowadays ;) (I know I know... I just couldn't resist) | |
Re: If you have it all in one file like that you need the hash.h portion up top, followed by the hash.cpp portion, followed by the main.cpp portion (and take out the hash.cpp/hash.h code you have pasted directly into main). The hash.cpp portion could be after the main program instead if … | |
Re: You don't need one as a shallow copy is okay. The compiler is complaining because you didn't put the () after [icode] myRecord.getpPtr [/icode]. | |
Re: > Thank you VernonDozier, I can ensure you that I always try hard myself before asking anything on the forum, the reason being that I want to learn how to program. > Thanks for posting the code, I had a look at it and I don't think I could have … | |
Re: What have you tried so far? Hint: use the getline function ![]() | |
![]() | Re: Just do a simple bubble sort. See [url]http://www.cprogramming.com/tutorial/computersciencetheory/sorting1.html[/url] for an example. ![]() |
Re: [QUOTE=slowlearner2010;1209885]thanks Ancient Dragon, really? thank for your info, i didn't notice it but everytime i start dat program it'll keep remind me that 20 more days left...i think to [/QUOTE] Sorry to bump your solved thread, but go to the help menu and the 6th option down is "Register Product". … | |
Re: Somebody else can probably illuminate this a little bit further, but there really is a y1 declared in math.h. It appears to be associated with an older version of the complex type(?). Seemingly, if you [icode] #define _NO_OLDNAMES [/icode] before you [icode] #include <cmath> [/icode] it should disregard those declarations. … | |
Re: [quote] here are my answers..plzzz check them for me. [/quote] Here's a wild idea. What happens when you run them in your program? Do they work there? And "plzzz" use code tags: [noparse][code] //code goes here [/code][/noparse] |
The End.