2,045 Posted Topics

Member Avatar for Jaily

Call [icode] srand((unsigned)time(0)) [/icode] only once before your first call to [icode] rand() [/icode]. This seeds the random number generator with the current time. You'll need to include [icode] ctime [/icode] (formerly time.h) for this.

Member Avatar for Jaily
0
156
Member Avatar for RobBobSmith

On line 34, why do you have your else within the braces of your if? What the compiler is telling you is that there is a path through that method (the path taken if [icode] x >= rows || y >= cols || x < 0 || y < 0 …

Member Avatar for RobBobSmith
0
190
Member Avatar for Ancient Dragon

[quote]Question What are the style quote-tags?[/quote] You're misinterpreting. He means ">> style" "quote tags" (quote tags in the style of >>) not ">>" "style quote tags". (just for clarification, not to steer this OT)

Member Avatar for Agapelove68
0
245
Member Avatar for cwarn23

@AD Since his application is on the CLR, it's probably easier to incorporate all of this as a BackgroundWorker class. @OP Check out [url]http://msdn.microsoft.com/en-us/library/system.componentmodel.backgroundworker.aspx[/url] and scroll about halfway down to "Examples" and make sure you have the C++ tab selected. It's not identical to what you are doing but you …

Member Avatar for Ancient Dragon
0
724
Member Avatar for mogaka

I don't know that it's going to be possible to do with Dev C++ (which is outdated as it is, and won't offer you a GUI designer nor the .NET libraries). Grab the VC++ 2010 Express Edition. The dialect used in this case is C++/CLI and is probably not a …

Member Avatar for daviddoria
0
222
Member Avatar for networkZombie

Please post your code, as you are probably on the right track. Think of how you would do it in life. Change is 1.01, how many dollars? 1. Remaining change 0.01. How many quarters? 0. dimes? 0. nickels? 0, pennies? 1. Remaining change, 0.00. What would happen if the change …

Member Avatar for jonsca
0
164
Member Avatar for BestJewSinceJC

[QUOTE=quicktpgo;1191334]I like The Big B[B]o[/B]ng Theory right at the moment. Sheldon is so geek!^^[/QUOTE] Is that a different show than the one on CBS? ;) [isarcasm] Careful, material like that is going to mess up your sig link hits. [/isarcasm]

Member Avatar for SgtMe
1
305
Member Avatar for silversurfer515

Try plain old "Curl" it comes as an .exe file (it still has some learning curve, but you don't have to compile anything). Go to [url]http://curl.haxx.se/download.html[/url] and pickup one of the binary packages. Also, if you are trying to use C++/CLI, then a reference on .NET's methods for C# would …

Member Avatar for jonsca
0
281
Member Avatar for shakssage

If you are using C++/CLI you should be able to use the Regex portion of the .NET library. See [url]http://msdn.microsoft.com/en-us/library/3y21t6y4.aspx[/url] for the namespace and syntax. If you're trying to do it to native C++, Taywin is correct, and you'd have to find a library to do your Regex processing (I …

Member Avatar for jonsca
0
163
Member Avatar for eagles39

You could have check answer return a 1 (for 1 correct answer) or 0 (not a correct answer) and have doOneProblem return that to the caller. Where is num_of_problems defined in main()? It's not. Take a quick look at your book's section on scoping. You are not calling getProbsperset with …

Member Avatar for jonsca
0
97
Member Avatar for clayton69692000

What are the compilation errors that you are getting? Note that among other things, your call to the putel() method in main doesn't take the same number of parameters as it does in the class definition. Also, with your out of bounds checks you place the element or return it …

Member Avatar for jonsca
0
97
Member Avatar for mbouster

Please use code tags [noparse][code]//code here[/code][/noparse] next time. Hint, use an if statement to either increment your index (value doesn't match with other) or leave it the same (if it's a duplicate). You will probably need to shift your while loop around to reflect this (and base its condition on …

Member Avatar for mbouster
0
108
Member Avatar for bigwhiteegg

Yes, it's the same. Structs and classes in C++ only differ by the default visibility of their elements (public for structs and private for classes).

Member Avatar for bigwhiteegg
0
81
Member Avatar for beatenbob

Pass your after pointer to your temp_ptr's setNext method, something like [icode] temp_ptr->setNext(after->getNext()); [/icode]

Member Avatar for jonsca
0
373
Member Avatar for DaveJohnson

I know it's not the answer that you want, but google for "macro recorder," and you can probably save yourself a lot of coding. I really don't know how to direct you to begin, but since this is one of those gray areas of computing, see if there's another way …

Member Avatar for jonsca
0
156
Member Avatar for Rez11

Check line 58 of the CPP file versus what you have in the header. They don't match up.

Member Avatar for Rez11
0
1K
Member Avatar for jonsca

On my post count graph in the profile it lists all the weeks and then it puts an entry for Jan 3rd at the very end. See screenshot below from when I mouse over it. I'm not sure where this is coming from as it doesn't represent any kind of …

Member Avatar for Dani
0
192
Member Avatar for Tiny_trixer

Seems to me your line class should contain the start and end points for a line. Then pass in a point to your "distance" method in Calculating. Seem like you might want a Point class too, perhaps...

Member Avatar for Tiny_trixer
0
135
Member Avatar for zhe05303

What have you tried so far? Which parts are giving you the hardest time? No one is going to be able to help you without some effort from you first.

Member Avatar for jonsca
-1
100
Member Avatar for bawbawbiscuit

It's probably in the same location as the .exe file. Either go to the directory into which you started the project or use Window's search utility to find it (you may have to expand the search area to include more than your documents, etc.).

Member Avatar for bawbawbiscuit
0
104
Member Avatar for slychronic

Use of the "dis" function (or a series of [icode]cout[/icode] statements) at strategic points in your program will let you trace it through step by step (or step through it using a debugger if you have one). If you then write a couple of sentences, someone can look at it …

Member Avatar for jonsca
0
121
Member Avatar for elminster67

Hint: what if your name input is not matched by the first line of the file? If they don't match keep going, reading in lines until it does. You need another loop. Using "out" as the name of your input file might be confusing to someone (or you!)trying to read …

Member Avatar for elminster67
0
175
Member Avatar for cwarn23

[QUOTE=Nick Evan;1179151]>> What time is it? [URL="http://www.youtube.com/watch?v=otCpCn0l4Wo"]Hammertime[/URL]![/QUOTE] You can't tell me he's not still the hero of millions of Dutch school children, Niek.

Member Avatar for cwarn23
0
123
Member Avatar for superchica08

Look at the condition on line 54. What happens when all of the sides are equal? Try testing for equilateral first. Also, while you are restructuring the loop, what happens when L1+L2 <=L3 (I think you tried to account for it but be careful which if/else pairs are associated with …

Member Avatar for superchica08
0
246
Member Avatar for sadia.ab
Member Avatar for Ancient Dragon

Peter is an actor, I believe. The answer's on Wikipedia (WaltP, you shouldn't trust that this generation of trivia buffs won't look lol) I won't spoil it.

Member Avatar for dexter737
0
164
Member Avatar for zortec
Member Avatar for dexter737
0
360
Member Avatar for kuchick32

Is there any requirement as to the ordering of the videos, or is it first entered goes into slot 0, etc? The spacing issues and slashes are just basic modifications to your cout statements, what specifically are you having problems with in that department?

Member Avatar for jonsca
0
128
Member Avatar for globberbob

Hand trace through the do/while loop with different conditions and you'll see that even if gender was equal to one, it would not be equal to 2 and vice versa, therefore your loop condition is true and the loop continues.

Member Avatar for globberbob
0
181
Member Avatar for mushahidh

To get something with similar function names and parameters try [url]http://codecutter.org/tools/winbgim/[/url]. It's terribly outdated and you'd probably have to rebuild it with VC++ (I haven't used it with either compiler so I don't know). Otherwise, David's and Mike's solutions are probably one of your better options. If you search around …

Member Avatar for jonsca
0
3K
Member Avatar for donmiq

When you give cin a bad input for "value" (e.g., 't' in your example), the stream goes "bad" and you need to issue a [icode] cin.clear(); [/icode] after line 32 to reset it. See [url]http://www.cplusplus.com/reference/iostream/ios/clear/[/url] (the example is for a file stream, but it's the same idea)

Member Avatar for donmiq
0
74
Member Avatar for bob200707

Why are you using methods meant for C-style strings (strcpy and strcat) when you are using std::string objects? Otherwise the gist of all the inputs and outputs looks ok. Look up the substr and find methods and what they give for results. Hint: the += operator will be helpful to …

Member Avatar for jonsca
0
380
Member Avatar for tKc

I think it's your formula. When I did it old school style by finding the mean and summing the square of (each element - mean), and dividing that sum by n, I got 9.54124 * 10^7, which is closer to your goal. If you want to use the formula where …

Member Avatar for jonsca
0
157
Member Avatar for jmcorpse

Hint: Write the bar graph out line by line. Draw out a sample by hand and see which values have stars printed on which lines. After you've figured it out using cout, send the output to your ofstream object instead. Give it a try and see how far you can …

Member Avatar for jonsca
0
99
Member Avatar for format_c

Your code is confusing. I'm assuming you assign a value to "a" in code you haven't shown, otherwise you're getting whatever junk is in "a" to begin with. Why not just use rand() to generate a start time, then call it again to generate a random offset from the start …

Member Avatar for jonsca
0
146
Member Avatar for The physicist

Check out [url]http://msdn.microsoft.com/en-us/library/aa904305(VS.71).aspx[/url] to see how to use the Split() method of the string. You will form a string array with each of the different tokens at a separate index. Depending on what data type they are you may need to parse them (see [url]http://msdn.microsoft.com/en-us/library/aa328656(v=VS.71).aspx[/url] for an example). You are …

Member Avatar for jonsca
0
192
Member Avatar for kra9853

See [url]http://cplusplus.com/reference/clibrary/cmath/pow/[/url] for a reference. Watch out for the overloads that are allowed (i.e., there is no overload for an integer to the power of integer, so you'll need to do appropriate casting).

Member Avatar for jonsca
0
79
Member Avatar for ginn69

[quote]can explain detail like write down the pseudocode and the whole c++ program.. thanks^^ [/quote] This looks suspiciously like a homework assignment. Please let us know what you have tried first. Working the problem on paper will help you write the pseudocode, etc.

Member Avatar for jonsca
0
71
Member Avatar for kavisg1

What have you tried so far in code? Can you create a project that has 2 (empty) classes in it?

Member Avatar for Momerath
0
176
Member Avatar for jmcorpse

If the user inputs 3:00 pm you need to convert that into 15 hours on line 56 so that you can compare it accurately against your seconds up to 11:59 am in line 83. Otherwise you are comparing 3 to 12, which is less than, thereby outputting your AM value.

Member Avatar for jonsca
0
137
Member Avatar for Dani

I think a majority of them are interesting but I like the futurist type things (I guess I am an "overall geek" as Nick put it). I'm not as captivated by things about social media.

Member Avatar for Ancient Dragon
0
662
Member Avatar for TotoTitus

I haven't done a lot with C++/CLI but coming back from C# to the C++ I learned first it has been interesting to play around with this illegitimate child of C++ and .NET. See [URL="http://en.wikipedia.org/wiki/C%2B%2B/CLI#Handles"]this[/URL] for question #2, it's quick but it will get you used to some of the …

Member Avatar for Milton Neal
0
1K
Member Avatar for peter_budo

I get the same restriction. It's too bad because that is a useful link. [quote]jonsca, you do not have permission to access this page. This could be due to one of several reasons: 1. Your user account may not have sufficient privileges to access this page. Are you trying to …

Member Avatar for Lusiphur
0
146
Member Avatar for sana_moi

Have a look at something like this: [url]http://msdn.microsoft.com/en-us/library/1b4az623.aspx[/url] This is one of those unfortunate cases where the unmanaged and the managed data types cannot be interchanged, you need to marshal the string.

Member Avatar for sana_moi
0
172
Member Avatar for captainSheepdog

It's not too bad: [code] Label^ lbl = gcnew Label(); //fill in the Location property (specify by System::Drawing::Point(x,y)) //fill in the Text property Controls->Add(lbl); [/code]

Member Avatar for captainSheepdog
0
103
Member Avatar for imthiyas92

Please don't type in all caps no need to YELL lol. What's the problem with the program? Is it not giving you the result you expect or are there errors? Please be more specific. Please place your code in [noparse][code]//code here[/code][/noparse] (it's not too late to edit your post).

Member Avatar for mike_2000_17
-1
874
Member Avatar for babug

Dude, the only thing you are doing is diluting and polluting your argument further (and believe me it wasn't much of anything to begin with). Science is a culture which seeks truth. Coming with membership in that culture is a great degree of responsibility to "play nice," contribute and demand …

Member Avatar for Sriman_Laxmi
0
1K
Member Avatar for bobbuilder67

There are a couple of things that are standing in the way of this compiling. When you posted last I assumed incorrectly that this would be a console application. Upon a closer look it appears to be an MFC (MS Foundation Classes) application which is not directly supported by the …

Member Avatar for sarah_10
0
2K
Member Avatar for PixelExchange

Depending on what system you are using textboxes can be read only or read/write. What are you trying to write this in (Win32 API, MFC, Winforms)?

Member Avatar for PixelExchange
0
116
Member Avatar for gregarion

See: [url]http://www.cplusplus.com/reference/clibrary/cstdlib/system/[/url] The function returns an [B]int[/B] that is "system-dependent" (could be an exit code for the program, could be garbage). Perhaps write the output of the program to a textfile (using "samp -s1122 > text.out") and read that into your program. I'm not sure if this is a case …

Member Avatar for jonsca
0
86

The End.