2,045 Posted Topics

Member Avatar for Haranadh

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 …

Member Avatar for jonsca
0
128
Member Avatar for tennis

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

Member Avatar for jonsca
0
105
Member Avatar for valeriy_zf

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

Member Avatar for jonsca
0
320
Member Avatar for soapyillusion

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 …

Member Avatar for soapyillusion
0
255
Member Avatar for PDB1982

For your ratio try 364.0/365.0, you probably keep getting 0 for 364/365 since it's still considered integer division.

Member Avatar for PDB1982
0
52
Member Avatar for charqus

[ICODE]pictureBox1.BackgroundImage = Image.FromFile("sa-mp-042.png"); [/ICODE]should work

Member Avatar for ashishkumar008
0
177
Member Avatar for cool_aj

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.

Member Avatar for jonsca
0
1K
Member Avatar for totalwar235

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.

Member Avatar for totalwar235
0
321
Member Avatar for xcarbonx

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.

Member Avatar for xcarbonx
0
95
Member Avatar for skorm909

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 …

Member Avatar for skorm909
0
361
Member Avatar for robinotje

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.

Member Avatar for WaltP
0
454
Member Avatar for iamfabian
Member Avatar for Violet_82

Put in a [icode] cin.get(); [/icode] between lines 33 and 34. This will effectively wait for a key to be pressed.

Member Avatar for Violet_82
0
139
Member Avatar for musthafa.aj

[quote]True story from IIT Bombay[/quote] [url]http://www.snopes.com/college/exam/flattire.asp[/url] .. and everywhere else.

Member Avatar for jwenting
3
173
Member Avatar for hannon565

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

Member Avatar for Nick Evan
0
3K
Member Avatar for BobFX

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 …

Member Avatar for jonsca
0
620
Member Avatar for stevechow
Member Avatar for jonsca
0
56
Member Avatar for phohammer

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.

Member Avatar for phohammer
0
413
Member Avatar for yin1031

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 …

Member Avatar for yin1031
0
104
Member Avatar for IDSTECH
Member Avatar for Lukezzz

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 …

Member Avatar for jonsca
0
175
Member Avatar for Kombat

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

Member Avatar for Kombat
0
152
Member Avatar for Lukezzz

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.

Member Avatar for Lukezzz
0
522
Member Avatar for ppotter3

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

Member Avatar for ppotter3
0
1K
Member Avatar for C++ Beginner

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 …

Member Avatar for jonsca
0
466
Member Avatar for ms_farenheit1

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.

Member Avatar for jonsca
0
122
Member Avatar for chinnaedu

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 …

Member Avatar for tetron
0
111
Member Avatar for misfits86
Member Avatar for Geekitygeek
-3
662
Member Avatar for dilake
Member Avatar for dilake
0
98
Member Avatar for dani_awais
Member Avatar for vmanes
Member Avatar for ddanbe
1
334
Member Avatar for falconxxxx

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

Member Avatar for anishakaul
-2
212
Member Avatar for arunkumars

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.

Member Avatar for jonsca
0
127
Member Avatar for khaled.s

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 …

Member Avatar for WaltP
0
239
Member Avatar for esdftw

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.

Member Avatar for esdftw
0
156
Member Avatar for angel6969

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

Member Avatar for jonsca
0
264
Member Avatar for Salem

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

Member Avatar for PedroStephano
0
707
Member Avatar for JustSuds

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 …

Member Avatar for Skeen
0
93
Member Avatar for Ed Ashworth

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 …

Member Avatar for jonsca
0
141
Member Avatar for spirit3ch

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

Member Avatar for jonsca
0
201
Member Avatar for hydersha

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.

Member Avatar for jonsca
0
852
Member Avatar for Jeronim

Can you give us an example of what a typical part_ would look like? Is it just like "400.0/20.0"?

Member Avatar for dusktreader
0
164
Member Avatar for faizanahmedin

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?

Member Avatar for jonsca
0
86
Member Avatar for charqus

Do they have the VC++ 2008 Redistributable installed? See [URL="http://msdn.microsoft.com/en-us/library/ms235299.aspx"]this[/URL] article.

Member Avatar for charqus
0
155
Member Avatar for Dizzzy

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.

Member Avatar for mitrmkar
0
314
Member Avatar for sidra 100
Member Avatar for sexyzebra19

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 …

Member Avatar for jonsca
0
135
Member Avatar for Mz3g

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 …

Member Avatar for Mz3g
0
363
Member Avatar for iammfa

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 …

Member Avatar for mrnutty
0
90
Member Avatar for mimis

Or attempt a design where it is created in main() and passed into the functions that require it.

Member Avatar for Fbody
0
97

The End.