2,045 Posted Topics

Member Avatar for bumsfeld

[QUOTE=frogboy77]It's like all "American" sports, more stop than start.[/QUOTE] Pray tell, what is the sport of your nation that puts the "American" sports to shame.

Member Avatar for diafol
1
162
Member Avatar for jasleen12345

Hint: is a space the only thing that can separate two words? Also, if the user hits enter, that's the second line. You're very close here.

Member Avatar for ravenous
0
637
Member Avatar for jonspeidel

You shouldn't call main like that. Basically, you don't go back to the main() that you came from, you start a "new" main when you call it. I'm confused as to why you are needing to call main anyway if the function is going to return right after that. Also, …

Member Avatar for 1ML
0
527
Member Avatar for slygoth

You have redeclared "smallest" and "largest" as ints in main(). There's no need to do that.

Member Avatar for slygoth
0
153
Member Avatar for alex55

Check line 36. I don't think it's the main problem, but it will catch up with you eventually.

Member Avatar for alex55
0
124
Member Avatar for crapgarden

I took a course in Systems Analysis and Design eons ago and was taught something like the following: [url]http://en.wikipedia.org/wiki/Systems_Development_Life_Cycle[/url]. I'm not a practitioner, so I don't know what people actually do, but that method of analysis abstracts it a bit from compilation and testing cycles, so it may not be …

Member Avatar for jonsca
1
186
Member Avatar for blessed87

Go through each element and keep track of the minimum and maximum values as you go. Also, add the element to a running sum and at the end divide by the number of elements.

Member Avatar for WaltP
0
203
Member Avatar for realproskater

Line 9 (second listing) should not look like that. Are you trying to call the function? It looks like a definition. Also, formatting your code with proper indentation would make it easier to spot errors with the braces. Lines 88-100 on the first listing seem like they are floating outside …

Member Avatar for realproskater
0
183
Member Avatar for airerdem

Use the "break;" that thelamb was suggesting. That will take you out of the j loop, but anything remaining within the i loop at the end will be executed. Then control will go back to the top of the i loop. There will be a fresh j loop at that …

Member Avatar for airerdem
0
108
Member Avatar for juangalvez4

If your function definition is after main() you need a prototype for your function at the beginning. It belongs between lines 5 and 7.

Member Avatar for VernonDozier
0
153
Member Avatar for Mayank23

Look on your start menu and under the Qt folder (or wherever you installed it), there will be a Qt 4.whatever command prompt icon. Starting that will put all of the proper environment variables in place for that session. There's some specific compilation steps that you'll have to look up …

Member Avatar for bramsever
0
562
Member Avatar for DaniwebOS

What are the messages that the compiler is telling you? Learning how to interpret them is an important skill. Start with the first error. If you can't figure out what it means, post it with the line number.

Member Avatar for jonsca
0
118
Member Avatar for dcasmac418
Member Avatar for jonsca
0
109
Member Avatar for knight92

[quote=gerard4143]most computer languages use C as its interface to the outside world. [/quote] Not to steal some of the spotlight from the thread, but I'm confused by what you mean when you say this. Good points Adak. [quote]see the assembly output of the compiler or interpreter[/quote] The OP wasn't specific, …

Member Avatar for Adak
0
364
Member Avatar for Kanoisa

[code]cin.get(); /* i know this is soo wrong and bad but im just lazy in small test appls to use proper pause code here or to pipe output to a file */ [/code] This is actually one of the most portable and safest methods of pausing. Just wanted to comment …

Member Avatar for Kanoisa
0
288
Member Avatar for ahtaniv

5. Is this homework? ;) Why don't you write out what you think the answers are and someone will check them over for you.

Member Avatar for Narue
0
188
Member Avatar for aguilaron
Member Avatar for illuminatus89

You've provided an excellent answer, vikashj, except that new and delete are not going to work in C.

Member Avatar for vikashj
0
75
Member Avatar for lochnessmonster

I've only skimmed through it in the past, but check out [url]http://www.freetechbooks.com/object-oriented-programming-with-ansi-c-t551.html[/url] (free and legal download). It does a lot of preprocessing on the code. Something you might be interested in, as I think it's at least peripherally related is the cfront system that converted C++ to C (see [url]http://en.wikipedia.org/wiki/Cfront[/url]) …

Member Avatar for Narue
0
182
Member Avatar for pawan_sharma777

At least 3 people already did: [url]http://www.daniweb.com/forums/post1336436.html#post1336436[/url]

Member Avatar for sheva249
-1
174
Member Avatar for cpp_learn

You can use the characters of stringValue1 directly (line 7 doesn't work, which you probably found out already). stringValue1[word] gives the proper character, and stringValue1.size() gives you the length. [quote]I just started C++ (new to programming) so I dont know all the functions.[/quote] Your professor knows that, which is why …

Member Avatar for jonsca
0
567
Member Avatar for Kamal_Java

I'm not sure how you'd do a direct conversion, but I'm assuming you're using their REST API. There's probably a call you can make to the server that when given the location, it'll send back the lat/long coordinates.

Member Avatar for jonsca
0
116
Member Avatar for KazenoZ

Are you using Winforms or Win32? If Winforms, search on "GDI+ tiling an image" (some of the examples are for VB, but the syntax should be easy to translate to C++/CLI) Are you trying to display it or do you need to save a copy out like that?

Member Avatar for jonsca
0
697
Member Avatar for abebosco

Take in your number as a string using fgets and check the string for good characters (characters from '0' to '9'). [quote]fflush(stdin); [/quote] Take a look at the links in [url]http://www.daniweb.com/code/snippet217396.html[/url] to see why that is not a good idea.

Member Avatar for WaltP
1
10K
Member Avatar for Josue198s

[QUOTE=sharathg.satya]we can use spit()[/QUOTE] In what library? That's not in the Standard C library for sure.

Member Avatar for sharathg.satya
-1
288
Member Avatar for Nandomo

Keep an array with the names of the months and search that instead of having that if/else block.

Member Avatar for ravenous
0
365
Member Avatar for jonsca

I recently was using the BinarySearch method and I was curious about why the designers had coded the method with the following for a return value: "Return Value The zero-based index of item in the sorted List, if item is found; otherwise, a negative number that is the bitwise complement …

Member Avatar for ddanbe
1
125
Member Avatar for elsiekins

Test whether [icode] letter.length() == 1 [/icode] and while you're at it, check to make sure it's a valid letter using isalpha() from <cctype> (or your own version). Can you not change the signature of the function to take a char?

Member Avatar for elsiekins
0
176
Member Avatar for SacredFootball

A "node" doesn't have an empty() method (if it did, you'd have to access it as copyPtr->empty() anyway, because copyPtr is a pointer). Did you mean to pass in stacks instead of nodes?

Member Avatar for jonsca
0
97
Member Avatar for chrishea

It's not just you, I've been having problems with navigating on the site tonight, too. There's a huge lag.

Member Avatar for Dani
0
351
Member Avatar for zidane010h

It doesn't run for the first turn through. In general, if the condition on a for loop evaluates to false to begin with, the loop is skipped. In this case, after the for is skipped, x is incremented to 1, the next cycle of the while loop takes place, and …

Member Avatar for zidane010h
0
217
Member Avatar for Jutch

average is not an array. You can't take the i-th member of something that only has one value. What are you trying to accomplish with that line?

Member Avatar for Jutch
0
203
Member Avatar for eduard77

You can use an iterator for what you are trying to describe (see the second post of [url]http://stackoverflow.com/questions/3221812/sum-of-elements-in-a-stdvector[/url]). Or you could use std::accumulate ([url]http://www.cplusplus.com/reference/std/numeric/accumulate/[/url] or the above link)

Member Avatar for eduard77
0
113
Member Avatar for ERadu

Have a look at this [url]http://www.daniweb.com/forums/post155265-18.html[/url]. It tells you how to avoid that situation.

Member Avatar for arkoenig
0
292
Member Avatar for begineer

dir is an uninitialized pointer, it's not pointing to any memory, so when you use gets (which you shouldn't regardless) you can enter characters until the cows come home and run right over whatever memory is adjacent to it. I would set up dir as a char array holding 256 …

Member Avatar for Ancient Dragon
0
212
Member Avatar for chamnab

Do you want the user to be able to type 5 characters and no more, or is it a case where you can just take the first 5 off of what they type?

Member Avatar for jonsca
0
96
Member Avatar for triumphost

Do your friends' computers have the Visual C++ Redistributables? (they come as part of the normal windows updates now, but they may have ignored them or removed them). If you have .dlls that go with your program, you have to make sure the other computer has them too.

Member Avatar for Ancient Dragon
0
384
Member Avatar for ndowens

[quote]The function "getinput();" is a prototype function..[/quote] I've never heard the term used like that. What exactly does it imply? Also, what could be considered an opinion or design choice, but the do/while loop avoids the potential stack issues with the recursive function.

Member Avatar for jonsca
0
181
Member Avatar for declna0872

In your loops where you are inputting the values, keep a running sum of the scores. Then outside of the loop divide by NUM_SCORES.

Member Avatar for Saith
0
2K
Member Avatar for DaniwebOS

Check out line 8 of your original posting, your prototype says that it takes 3 arguments. Something must be changed so the number of parameters matches up in your prototype (line 8), your definition(line 63), and your function call (line 22).

Member Avatar for DaniwebOS
0
131
Member Avatar for bufospro

Check out Emergent [url]http://grey.colorado.edu/emergent/index.php/Main_Page[/url]. It's got a bit of a learning curve, but in return for it you get a very powerful tool. I haven't used it recently, so I'm not sure how much help I could be with it. This one [url]http://www.justnn.com/[/url] is more straightforward.

Member Avatar for bufospro
0
101
Member Avatar for somshridhar

In your simple program, is it displaying the "Enter a number" prompt? Putting an "endl" after a cout statement puts in a newline and also flushes the output buffer. I believe you can simply put a "flush" if you don't want the newline.

Member Avatar for WaltP
0
172
Member Avatar for L3gacy

Go into C::B and open up Settings/Compiler and Debugger Settings and select GNU GCC Compiler at the top (assuming you load up C::B on your laptop with the default compiler). Select the Compiler Settings tab, and go down about 9 entries to "Have g++ follow the coming C++0x ISO C++ …

Member Avatar for mike_2000_17
0
401
Member Avatar for wildplace

Consider a smaller example: [code] 1000 0000 //0x80 as a mask Take the number: 0100 0110 //70 decimal & it with 1000 0000 = 0000 0000, first digit is 0 <shift bit of mask to the right> 0100 0000 & it with 0100 0110 = 0100 0000 => second digit …

Member Avatar for wildplace
0
78
Member Avatar for emreozpalamutcu
Member Avatar for jonsca
0
109
Member Avatar for FL Botanist

Take a look at this: [url]http://www.cs.tut.fi/~jkorpela/forms/cgic.html[/url] Common Gateway Interface is the name for this sort of thing (Colby even calls it that on the websiste). That link goes into some of the technical aspects of it, but it seems if you can find hosting that will run CGI scripts then …

Member Avatar for FL Botanist
0
251
Member Avatar for DaveTran

It might help to know what you are trying to accomplish, unless this is just an exercise in theory.

Member Avatar for DaveTran
0
100
Member Avatar for snkiz

If you are concerned about the vcard you can get rid of it under control panel/Settings and Options(on the left)/Edit options [quote]I'd love to hear them tell that directly[/quote] If you hover over Ezzaral's panel on the left of his post, then you can see that he is a moderator.

Member Avatar for ~s.o.s~
0
461
Member Avatar for TailsTheFox

If your textbox is named textBox1, the textBox1->Text member contains the text that was typed in. Place a button on your form and double click it, and type your code in the button handler to display it in a message box or whatnot.

Member Avatar for TailsTheFox
0
112
Member Avatar for becool007

Just select a "Win32 console project" to do "regular" C++. The alternative to .NET is using a "Win32 project," where you can use the Win32 API (see [url]http://www.winprog.org/tutorial/[/url] for an excellent intro to the subject). There's a steeper learning curve for the Win32API, but it brings you much closer to …

Member Avatar for jonsca
0
117

The End.