2,045 Posted Topics
Re: Are you looking for a specific ordering like 000-111-2222 ? If that's the case you might want to try a masked text box. There is a current thread in C# on this ([url]http://www.daniweb.com/forums/post1440491.html#post1440491[/url]) (I know it's not the right language, but it's the same .NET library, so you'd just have … | |
Re: [QUOTE=subtracktor]I hope this will help you [/QUOTE] No, in fact you've hurt his/her chances of learning from this because you've done it for him/her. | |
Re: If you are on a different platform than he is (Linux vs. Windows) you're going to have to compile his code on a Windows machine. He could conceivably generate a Windows binary, but it's not the default and it's probably too much trouble at this point. have him send you … | |
Re: It might be helpful if you gave a brief snippet of what you are trying to do. | |
Re: On the left hand side of your post (the post in question, not this one), underneath your name, hit the "Flag Bad Post" button and explain your situation to a moderator. | |
Re: Can you read the values in and write them back out again? Start there if you can't. | |
Re: Some think that it translates from the ancient phrase meaning "for the love of all things good, get a book on C!" (and before you judge Jonsca, this is the 4th (my fact checkers say) such request from this OP) | |
Re: [QUOTE=group256]Man, I'm sorry but, do you really expect us to answer your question?[/QUOTE] The poster has not explicitly specified that he/she is using C++/CLI and .NET, but this is a perfectly understandable question. It's good that you're concerned about post quality, though. @OP: Set [icode] pictureBox1->BackgroundImage = nullptr; [/icode] | |
Re: If you are using C++/CLI like you were, a String ^ has an identical ->Split method to the one in C# (since it's all .NET). I think it requires a cli::array<String ^> to accept the pieces. I suppose you could use a stringstream, but you'd have to convert your String … | |
Re: Can you do it without MPI? Try that first. | |
Re: You have to translate this code from nobugz in this post from C# into C++/CLI [url]http://social.msdn.microsoft.com/forums/en-US/winforms/thread/60b2493d-c8ff-495d-b845-d114fe456f54/[/url] I'm taking a shot at it, but see what you can come up with from there. | |
Re: There's nothing technically wrong with using printf, but there are ways to accomplish the same thing using cout. In particular, look at the examples: http://www.cplusplus.com/reference/iostream/manipulators/fixed/ http://www.cplusplus.com/reference/iostream/manipulators/setprecision/ It looks to me like your assignment is saying all you need to do is output the number of each of the bills and … | |
Re: How is this any different than your other thread? | |
Re: Check out [url]http://www.cplusplus.com/reference/iostream/manipulators/setprecision/[/url] , in particular the example. | |
Re: Why does your function on 324 return float? You are using doubles in the body of the function and then trying to cram the double (with it's additional precision back into the float). This is a warning from the compiler but it should be addressed. Change line 30 to [icode] … | |
Re: You're going to have to use either a char or an int array to hold the numbers. [code] ex 1234 => |1|2|3|4| [/code] You'll have to write a procedure to do the multiplication and division digit by digit Or if you can use a library, there's [URL="http://gmplib.org/"]GMP[/URL] or MPIR if … | |
Re: Since your numbers are integers, you need an integer parameter for your function. Have it return a std::string. | |
Re: You need to either explicitly have a using statement for [icode] System::Collections::Generic [/icode] or qualify it as [icode] Generic::IEnumberable<Item ^> [/icode] You're not going to be able to use a std::vector without a lot of hassles. Change it to the cli::array that it's asking for. Google for the syntax. Also, … | |
Re: I would use getline() to read in each line as a std::string. When it comes to those lines which are variable, read the string into a stringstream and use the >> extraction operator to pull out what you need. That way you can compare each line with "----------" to see … | |
Re: Take out the .h, that's the filename, you want to instantiate an object of type Form1. [icode] Application::Run(gcnew Form1()); [/icode] | |
Re: Post some of the surrounding code for this one. You're trying to initialize something within a class declaration or struct. | |
Re: Line 79 of your first listing you have a semicolon after the if statement. Also, remember than in C++/CLI the . operator of C# can translate to a namespace or a member function. (so either a :: or a -> or even a . for a non-pointer) But, AD is … | |
Re: Check and make sure he has the redistributables (e.g., [url]http://www.microsoft.com/downloads/en/details.aspx?FamilyID=a7b7a05e-6de6-4d3a-a423-37bf0912db84&displaylang=en[/url]). He may also need the 2005 or 2008 ones for any older dlls, check and see if the 2010 ones supersede those in the 2005 and 2008 redistributables. | |
Re: At least post the order of your headers at the top of your code. Is a header you wrote listed ahead of some of the standard ones? If so, you may be missing a ; after one of your class declarations. | |
Re: What type of videos (mp4, flv, etc) are they? You're probably going to need to use a Windows Media Player control [url]http://msdn.microsoft.com/en-us/library/dd564582(VS.85).aspx[/url] or another API appropriate for your video type. | |
Re: Don't type in your event handlers by hand, the IDE provides a mechanism. If you really want to do it by yourself, let the IDE do one and watch where it places the code. Go to the form designer, select your form. On the right hand side there is a … | |
Re: You do not need the datatypes when you make the calls in main() on lines 68 and 69, that is what the compiler is choking on. However, there is no need to pass the object into itself, as it already has access to the members and methods. | |
Re: [quote=chiwawa10]I don't think you can read int from the file using ifstream. [/quote] Did you try it? You certainly can. [QUOTE=Saith]Glad you got the answer :D I would suggest you use the following whenever you use a file for data. It may help with an immediate solution that would otherwise … | |
Re: Which compiler are you using? They do have a makefile for VC++ version 10. If you have cygwin, etc. you can use the build instructions for *nix. | |
Re: Certainly. What progress have you made with the code yourself? | |
Re: [quote] Test 1 25 % Test 2 25 % Test 3 25 % Final 50 % [/quote] adds up to 125%. I think one of your numbers is off. | |
Re: If you're talking about making a Windows Forms application, see [url]http://www.functionx.com/vccli/index.htm[/url] for an intro to the malevolent world of C++/CLI. If you are after MFC (only available in the full version of VS) google for tutorials on that. If you want to do things at a more fundamental level (Win32 … | |
Re: [quote]My first problem is what is a switch statement and what does it do in this program? Why is there a break after each case (I know it changes the flow of control of the program but I am not clear how it changes it). What does cout << ..; … | |
Re: Before I look at this at all, you need some formatting lessons. Please, please take a look at [url]http://www.gidnetwork.com/b-38.html[/url]. At least you got it into code tags, but no one can read what you have above, with everything jammed onto one line. Please repost it with proper formatting. main should … | |
Re: [quote][code]Handles panel1::MouseDown XP = MousePosition.X - this->Location.X YP == MousePosition.Y - this->Location.Y;[/code][/quote] What are you trying to do with this line? It doesn't make much sense to me. [quote][code]Button3_Click(ByVal sender As System::Object, ByVal e As System::EventArgs);[/code][/quote] This looks a lot like VB.NET to me. The languages can interop on an … | |
Re: Take a look at this page: [url]http://www.cplusplus.com/reference/iostream/manipulators/fixed/[/url] | |
Re: Do you have an Express Edition of Visual C++? If so, you are probably trying to compile an MFC program with it, and you need the full version of Visual Studio for that. EDIT: Edged out by AD by a hair | |
Re: I don't want to speak for anyone else, but rather than having someone do an entire walkthrough of your code, you could pick out sections that are problematic, and post those. Someone is much more inclined to wade through 20-50 lines rather than a few hundred. If you have large … | |
Re: Head First C# is a great introductory text that is very "active" and engaging (for people of any age group). There's a new edition for C# 4.0. There's not a lot of depth to it, but it covers a large chunk of the language and has some fun labs. | |
Re: [quote]I think I haven't stepped through each character at all.[/quote] You would have to in order to get the frequency information. | |
Re: To make your code neater you can hit enter(just not in the middle of your strings), like: [code] cout<<"According to my calculations...if you were to buy..." <<userinput[0]<<" cars for $" <<userinput[1]; [/code] as the compiler will get rid of the whitespace. The nice thing about cout is that you can … | |
Re: When i and j are 0, index = -width, which is incorrect. For the row 1 (the second row) you want width*1 + j (offset of 1 row + the column offset). | |
Re: My impression of XML was that it has the angle brackets <> instead of square brackets []. Perhaps you can do a global search and replace on your document before you process it. There are a host of methods under the System::Xml namespace (see [url]http://msdn.microsoft.com/en-us/library/system.xml.xmltextreader(v=VS.100).aspx[/url]) where you can extract the … | |
Re: Use a streamreader for the first one, a streamwriter for the second. [code] StreamReader ^ sr = gcnew StreamReader(filename); String ^ temp; while(temp = sr->ReadLine()) listBox1->Items->Add(temp); [/code] | |
Re: There's NO NEED TO TYPE IN CAPS. We can hear you just fine. If you are working in C, this should probably be moved over there. I'll flag it for a mod. | |
Re: The compiler is not generating a default constructor for your struct. I'm not absolutely sure why, so I won't speculate and steer you in the wrong direction. Where does Point come from? | |
Re: I'm not a board-certified psychiatrist, but I'm fairly sure that's not the case. I think he suffers from CDH, can't do homework. Just as a PSA: The more your title cries out for attention, the less attention it will get. The more intelligently written your title is, the more help … | |
Re: Would it help you to know that subtracting '0' from '1' though '9' gives you the integer value of that character? '1' - '0' = 1 '2' - '0' = 2 etc. | |
Re: [QUOTE=alexchen]Use code tags [/QUOTE] It was spam anyway. |
The End.