2,045 Posted Topics
Re: Modify the constructor of Form2 to take a reference variable of myCode's type, pass it in when you instantiate form2 in form1. The not all codepaths return a value just means that, well, there are paths through that method that do not have a return value (like an if, else … | |
Re: You're in C++ now, friend. It won't work if you compile it as C (I'm not up on language extensions and C99 at all but I still don't believe so). | |
Re: Rather than instantiating a new fr1 within your class, let the constructor of Test take your form as an argument: [code] In the declaration in the header: private: Form1 ^ frm1inclass; In the cpp file: Test1::Test1(Form1^ form1) { this->frm1inclass = form1; } void Test1::ChangeButtonText() { frm1inclass->button1->Text = "Whatever here"; } … | |
Re: str() is a method used with stringstreams to get the string portion. It doesn't seem like you need stringstreams or str() here. Remember that you can access strings as an array, so string[0] is the first character of the string. [icode] string.str(s) <= s [/icode] doesn't make any sense. You … | |
Re: For your ratio try 364.0/365.0, you probably keep getting 0 for 364/365 since it's still considered integer division. | |
Re: [ICODE]pictureBox1.BackgroundImage = Image.FromFile("sa-mp-042.png"); [/ICODE]should work | |
Re: Your first argument in the search function should be prototyped as [icode] theStudent [] [/icode] instead of int [] (and probably needs to be changed in your function definition as well. | |
Re: Check your "namspace" line. Also include <string> for std::string, not <string.h> (string.h has strcpy, strcmp etc stuff for C-strings). That's what I get at a glance, there may be more. And yes, you should post your error messages as we should not be your compiling service. | |
Re: This works too [icode] #include <iomanip>[/icode] [icode] cout << " The mean is: " <<fixed<<setprecision(2)<< mean << endl; [/icode]. It doesn't have to be in the statement itself, it can be beforehand. | |
Re: Vmanes is right, but also find a good book or resource online (I know that Schildt's book is available on [URL="http://msdn.microsoft.com/en-us/beginner/cc305129.aspx"]Microsoft's site[/URL] for free -- I think you need a login/hotmail to get access to it) or look at the sticky thread at the beginning of this forum. It's important … | |
Re: If you are writing a C++ program why are you only using the C libraries? See [URL="http://www.gidnetwork.com/b-56.html"]this[/URL] about gets(). It may not solve all the problems with your code but it will be a step in the right direction. Use something like [COLOR="Green"]f[/COLOR]gets for all your char array inputs. | |
Re: Can you give a typical line from the file? | |
Re: Put in a [icode] cin.get(); [/icode] between lines 33 and 34. This will effectively wait for a key to be pressed. | |
Re: [quote]True story from IIT Bombay[/quote] [url]http://www.snopes.com/college/exam/flattire.asp[/url] .. and everywhere else. | |
Re: It's best [URL="http://www.daniweb.com/forums/post155265-18.html"]not to use EOF[/URL]. You probably don't have to read character by character also. Look into the >> operator and the getline() method of istream (implemented by ifstream). | |
Re: Try substituting these in for line 8. You were trying to pass it into client as static which might work but this way you get all the proper info in there. I tested it, it works. [code] CredentialCache ^ mycreds = gcnew CredentialCache(); mycreds->DefaultNetworkCredentials->UserName = "bob"; mycreds->DefaultNetworkCredentials->Password = "bob"; client->Credentials … | |
Re: Try [URL="http://mathbits.org/MathBits/CompSci/download.htm"]this[/URL]. | |
Re: What is the name of your textbox? Identifiers like that are case sensitive so if it's "Textbox" or "textBox" (more likely the latter) it's not going to work. | |
Re: This is a frustrating thing to deal with. I looked at it as such: Make a class that holds your data points in a list and has a member method Draw, drawing each point up until time. [code] void Points::Draw(Graphics^ g , int time) { Pen ^ mypen = gcnew … | |
Re: You can get which button was pressed via the e->Button member of the MouseEventArgs object. I don't know your design (sounds scary with all those controls lol) so I'm not sure what the button43 has to do with it, but you can get a MouseEventArgs in the button43_MouseDown if you … | |
Re: [icode] scanf("%c", &a); [/icode] is not correct. Try using fgets() instead. After getting your number string, immediately print it out to make sure it's ok before moving on to process it. [icode]printf("%s", c);[/icode] would not be correct either, you are trying to print out an int as a string. | |
Re: You get where the click came from via the e parameter. e->X gives you the x coordinate and e->Y the y. It's going to be tricky to get your user to grab the exact point I think, you may want to use a (small) range. | |
Re: In your AveArray method: [code] float AveArray(int Numbers[], int Total) { // Declared Variables int sum = 0; //INT // Just to make sure there isn't any junk values. float Mean = 0,0; for (int i = 0; i < Total; ++i) { sum += Numbers[i]; //INT } Mean = … | |
Re: The actual error is in main() in line 34. You have make declared as private in your class so you cannot access it with the dot operator. In the same way as you have a getMake() method, you need a setMake() method to change the private value and act as … | |
Re: Can you post your header up? I can recreate most of it but it's time consuming to do so. More than likely you have an exception that is sneaking past your catch statements but I am not certain of that. | |
Re: I would search for the second instance of the colon, [code] int pos; bool found = false; for(over the buffer) if (found && buff[i] == ':' ) { pos = i; break; } else if(buff[i] ==':') found = true; etc. [/code] march up until the / to get the digits … | |
Re: Quit posting this nonsense in every forum. Stick to one posting. | |
Re: For which setting? What you are looking for might be under Build. | |
Re: It's even more gauche to pronounce it "Gow-chee." That's just plain meta-gauche. | |
Re: [QUOTE=anishakaul;1124223][CODE]#include <string>[/CODE] Its [B]string.h[/B] not string[/QUOTE] It's actually [icode] #include <cstring> [/icode] in standard C++. For your infile stream you don't need to open up the file using open and then pass it into your inFile constructor. On line 16 you can just say ifstream inFile( ) with a null … | |
Re: See [URL="http://social.msdn.microsoft.com/forums/en-US/vbgeneral/thread/72a05305-2698-4adf-b8bc-35a3eb0835a7"]this[/URL]. It's for VB but the difficulty is exactly the same. They say to add a PrintDialog to the form in addition to the webbrowser control. | |
Re: You really have 2 different main() programs that you are trying to compile as one unit. Split it up into two. In the first file go from the headers to the first closing brace. In the second file copy in just the headers (#include, etc), add in an [icode] int … | |
Re: Welcome. So what have to tried so far? It might be easier if you posted 1-2 lines of your text file since it's sometimes tough to assimilate the information in the abstract. | |
Re: [quote]S= standard deviation = square root of (sum/N) [/quote] FWIW, and I don't think it affects it too much for OP's purposes, it should be N-1 instead of N since it's a sample from a population (unless you have enough data to justify a population). Not knowing the population gives … | |
Re: [QUOTE=apegram;1108445]My password is always the day of the week my password was created. I tell people that, too, because it's not like they'll know what day of the week I created it. That makes it secure. Extremely secure.[/QUOTE] And assuming you don't vary case, there's like 10 to the.... er … | |
Re: For a class or a struct that's being referred to by a pointer, -> represents the dereference of the pointer followed by a dot operator. For example say you have a class MyClass and public member function myMethod: [code] MyClass * mycl = new MyClass(); mycl->myMethod(); would be the same … | |
Re: Do your applications use either the MFC (MS Foundation Classes) or the ATL (active template library)? Those libraries are only found in the Standard Edition and higher. Otherwise VC++ Express only supports pure Win32 and Winforms for C++/CLI. I'm not absolutely sure what in terms of the actual C++ standard … | |
Re: [quote]169 C:\Users\...\sequence.cpp 'class Sequence' has no member named [COLOR="Red"]'conacatenate'[/COLOR] [/quote] There may be other things wrong but did you read this error message carefully? You have a typo in there somewhere. [icode]Sequence s3 = s1.conacatenate(s2);[/icode] Right there. | |
Re: Make an int array that has 10 elements (so you have one for each digit). Up the count in that "bin" when you encounter a particular digit. Output your array. | |
Re: Can you give us an example of what a typical part_ would look like? Is it just like "400.0/20.0"? | |
Re: Can you clarify with an example? Are you talking about something declared as public within a class? You can certainly use the . operator: [icode] (in main you declare) myclass myobject; myobject.mypublicvar = 10;[/icode] Something like that? | |
Re: Do they have the VC++ 2008 Redistributable installed? See [URL="http://msdn.microsoft.com/en-us/library/ms235299.aspx"]this[/URL] article. | |
Re: Try [URL="http://www.cplusplus.com/reference/clibrary/cstdlib/itoa/"]itoa[/URL]. It's not standard so there may be portability issues but I think most implementations have it. | |
Re: What are some of your ideas? I don't want to spoil your fun. | |
Re: You shouldn't repeat all those calculations over and over in each branch of the if statements. Do the common calculations, have an if statement that changes any values that are uncommon to the set, then proceed with the next set of common calculations for the group, etc. Also, you should … | |
Re: You can use a stringstream: [code] #include <sstream> ..... stringstream ss; cout <<"Enter store no.:"; cin >> number; ss <<"Store "<<number; [/code] Then use ss.str() to get the std::string version and ss.str().c_str() to get the c string version for strcmp. There's probably a different approach that would work but I … | |
Re: That is true. Also check the number of bytes a short int occupies on your machine (using sizeof). Mine is 2 bytes. Since short is signed so you only get half of the range. The maximum in that case is 32767. You're way over that from the get-go on line … | |
Re: Or attempt a design where it is created in main() and passed into the functions that require it. |
The End.