1,358 Posted Topics

Member Avatar for moey187

We aren't going to do your coursework for you. In fact, the site's rules, which you obviously didn't read, forbid it. If we did the work for you, what would you learn? Answer: You would learn nothing. If you start your work, and can provide evidence that you have tried …

Member Avatar for ntrncx
0
564
Member Avatar for Labdabeta

Something is bothering me about your situation, I have a sneaking suspicion there may be a design issue. As far as I know, and as I understand your query, what you have demonstrated as your specific intent is not possible, but there are things you can do to clean up …

Member Avatar for Fbody
0
204
Member Avatar for Cece Skies

Your error is on line 256. :P In case you didn't realize it, that was sarcastic. You may want to consider actually showing us your code, we're not psychics. (Although, WaltP seems to think he is ;))

Member Avatar for Fbody
0
31
Member Avatar for Banf

Unfortunately, the forum rules require that we obtain from you evidence of your own effort before we can help, and there really isn't any here. [URL="http://www.daniweb.com/forums/announcement8-2.html"]Please see this.[/URL] Besides, if we don't see what you've done, we have no way of helping you anyway. We're not mind-readers; we assume a …

Member Avatar for frogboy77
0
294
Member Avatar for sha11e

A C++ namespace is not simply extra syntax and/or overhead, it's a system/mechanism within the language that is designed to prevent name collisions. The std namespace is enormous, every compiler-provided variable/constant/function is contained within it. When you say [icode]using namespace std;[/icode], you make all of those names visible to your …

Member Avatar for Fbody
0
173
Member Avatar for fadi_1234
Member Avatar for TheWolverine

Have you tried opening the file in binary mode? When you open a file in binary mode, the end-of-line character(s) aren't converted when read/written...

Member Avatar for mike_2000_17
0
387
Member Avatar for bleedsgreen33

[B]>>Write a value-returning recursive function that uses the DigitSum function of part 1 to compute the single digit to which the int arguments digits ultimately sum.[/B] This is a weird wording. It sounds like you need another function, which I'll refer to as "findMinDigitSum()", that is recursive, but each recursion …

Member Avatar for Fbody
0
139
Member Avatar for eman 22

You can, but it's not generally advisable to #include a *.cpp file. What are you trying to do?

Member Avatar for mike_2000_17
0
554
Member Avatar for TheSassyDragon

:confused: You're really not making much sense. It seems you want the "outer" vector sorted based on the contents of the "inner" vectors, and you want the contents of the inner vectors to be stable. Is there a reason you are using vectors to store a specific "person"'s information? I …

Member Avatar for TheSassyDragon
0
156
Member Avatar for caltech

It is advisable for you to get a grip. This type of post is extremely unprofessional and immature. Your values aren't all coming to zero (0). They are initialized to 0 when the program starts, which they should be, but they get modified as it executes:[QUOTE=program] 0 0 1 0 …

Member Avatar for VernonDozier
-7
249
Member Avatar for bentring34
Re: game

It depends on how they were written. C++ is a cross-platform language. You can use it to write for any platform that has a C++ compiler developed for it. The big question is whether or not OS-specific libraries are used by the program. If they were, you're likely to have …

Member Avatar for Fbody
0
98
Member Avatar for taumang
Member Avatar for scarlettmoon

An error like that typically means you are overrunning the limits of an array and corrupting memory used by other parts of your program or other parts of your system. [CODE] const int NUM_PLAYERS = 5; Team player[NUM_PLAYERS]; //... for(index = 0; index <= 5; index++) { }[/CODE] Your array …

Member Avatar for scarlettmoon
0
134
Member Avatar for NvIs

The way this is usually done is with an "account" type that has a "balance" member and "deposit" and "withdraw" methods. Are you familiar with functions? I think it would be advisable to create deposit and withdraw functions that handle the manipulation of the account(s) for you.:[CODE] struct acct { …

Member Avatar for NvIs
0
91
Member Avatar for Buolbear4444

You'll have to detect a "fail" or "bad" state on the input stream, then flush and reset it. [URL="http://www.daniweb.com/software-development/cpp/threads/90228"]Read this thread.[/URL]

Member Avatar for Fbody
0
63
Member Avatar for MadRedCzech

There are 2 ways to do it. You can wrap the function in a loop and simply store the return of the function to an element of the array, or you can pass the array to the function as an argument and handle all of the input and storage directly …

Member Avatar for livinFuture
0
214
Member Avatar for skips

Please be specific. Simply saying "It keeps giving me an error message" is an almost completely useless statement. What is the specific error? For starters, you clearly don't know how arrays don't work. The declaration:[CODE] std::string date[9][/CODE]declares an array of 9 strings numbered 0-8, not a 9-character-long char array. Thus, …

Member Avatar for skips
0
698
Member Avatar for Silvershaft

I don't do GUIs yet, so I really can't say, but I suspect that will depend on what you want to do with your program. You may want to share that information.

Member Avatar for Stefano Mtangoo
0
468
Member Avatar for osirus0830

The array-index operator is actually a type of de-referencing operator, like * or ->, that's specific to arrays. The operator has lower operator precedence than the other de-referencing operators, so it behaves strangely in these situations. You need to get to the element before you try to dereference it. Have …

Member Avatar for osirus0830
0
184
Member Avatar for ninjatalon

Your phrasing "I don't know what variable or how the TFaculty objects are being placed into memory" makes it sound to me like what's confusing you is actually the dynamic allocation (the "new" operator), not the virtual functions and polymorphism. When a program is running, it accesses two (2) different …

Member Avatar for Fbody
0
143
Member Avatar for gladtoplay5

Your code's current formatting leaves something to be desired, it's ineffective and inconsistent, so you've made a common rookie mistake. You've mis-matched your braces. Here is your code reformatted for better readability:[CODE] #include <iostream> #include <conio.h> #include <cmath> using namespace std; double radius; double circumfrence; double area; double diameter; int …

Member Avatar for Fbody
0
341
Member Avatar for fibbo

[QUOTE=arkoenig;1522922]I suspect the solution is [CODE]std::vector<passenger*>& passenger_queue::passengers_at_floor(int floor_) [COLOR="Red"]const[/COLOR][/CODE] The point is that at present, passengers_at_floor is permitted to modify its object, but you're passing it a const object, namely the key from a map. So you need to add const to the definition of passengers_at_floor, as a promise that …

Member Avatar for fibbo
0
7K
Member Avatar for zaneulhaq

You're about the third person I've seen ask a question like this the last couple days. This must be some sort of exercise for a class. What is the focus of your current chapter? The behavior you are seeking is certainly possible; odd, but possible. You could do it through …

Member Avatar for Stefano Mtangoo
0
410
Member Avatar for amna masood

Well, your code as posted is not readable. So, you can start by re-posting your code within [b][noparse][code]...code blocks...[/code][/noparse][/b] to make it readable. The error means that you are most likely missing a '}' somewhere after that point.

Member Avatar for amna masood
0
104
Member Avatar for helpplease234

[CODE]if (cin.fail()) { cout << "Bad input, please enter another positive integer (use cnt-Z to quit)" << endl; cin >> number; return 0; }[/CODE] To start, this is an if, not a function. That return terminates your program. You'll have to get rid of it. Once you've corrected that, look …

Member Avatar for Fbody
0
301
Member Avatar for tometherton

Do you have to consider values that are less-than the "target" value as well, or just values that are greater-than-or-equal-to the "target"? Are the array values randomly-generated, or are they pre-determined values as part of the program specification? Are there max/min legal values for the "target" value?

Member Avatar for tometherton
0
109
Member Avatar for joru819

Your problem is that you are attempting to use identifiers declared as local to main() inside of functions that they do not exist in.[CODE] void someFunc(); int main() { int anIntInMain = 15; //declare an integer local to main() someFunc(); return (0); } void someFunc() { int someTotal = 0, …

Member Avatar for Fbody
0
759
Member Avatar for subwired

Is there any more syntax directly before or after this? This almost looks like part of a C-style bit field...

Member Avatar for abhimanipal
0
121
Member Avatar for keeda

>>represent each denomination by a class(eg: $5Class, $10Class etc.). Here is your answer right here... If you want to create an inheritance hierarchy, a good place to start is your description of what an object [B]is[/B]. A five-dollar bill [B]is a[/B] monetary denomination representing a value of $5. An example …

Member Avatar for Fbody
0
270
Member Avatar for fandango

What exactly is this program? Why do you need all this interconnected access? This sounds like a very long series of very bad design decisions...

Member Avatar for Fbody
0
208
Member Avatar for surajdevesan

Borland is pretty old, I've never used it, so I can't give you specifics. But it looks like your project isn't configured correctly for a Windows API program. You'll have to look through your project's configuration to find the setting that tells the compiler the name of your program's entry …

Member Avatar for Fbody
0
122
Member Avatar for rbduck09

Programming is about decomposing large problems into smaller problems. You need to solve the small problems, then combine the small solutions into a solution to the larger problem. What do the different variables and portions of the equation represent? You should be able to create an "compounding" (or similarly named) …

Member Avatar for rbduck09
0
244
Member Avatar for VBNick

You might want to try to use Run-Time Type Identification. [URL="http://www.cplusplus.com/reference/std/typeinfo/"]The <typeinfo> header[/URL] is useful for this. I'm not sure how well it will work because you're using it on a pointer to a subclass though. The function you'll want is typeid(), but it's rather obscure and really not very …

Member Avatar for VBNick
0
237
Member Avatar for margeaux54

[QUOTE=w1mark;1514994] I know 2 bits can have the binary combinations 00, 01, 10, & 11, but does it really only store 3 combiations? Does this have to do with you don't count 00 as it would be the special null character?[/QUOTE] I uses all of the combinations available to it, …

Member Avatar for Fbody
0
170
Member Avatar for HASHMI007

[QUOTE=HASHMI007;1514660]no dear i want to take values of x & y bye another function.[/QUOTE] What do you mean by "I want to take values of x & y by another function"? Do you mean that you want to input them in point::set(), then send them to point::init() for the final …

Member Avatar for HASHMI007
0
112
Member Avatar for benchz23

It's not even that, it's a pseudocode algorithm. It's up to you to translate it to C++ code that behaves similarly and meets your objective. No one here is just going to hand you the solution on a silver platter. Also note that most C code is also perfectly valid …

Member Avatar for Fbody
0
172
Member Avatar for UltimateKnight

Speaking of link spam.... Nice signature. 10 of your 12 posts are within the last hour. EDIT: Oops, Nick beat me to it...

Member Avatar for Tamlyn
0
302
Member Avatar for silverpanda

Um... We're willing to help, but we're not stool pigeons. You actually have to do something yourself first. Have you attempted any of your own debugging? If so what have you tried and what have you found? Are you getting compiler errors? What are they? etc...

Member Avatar for pseudorandom21
-1
145
Member Avatar for mmartino

It looks like it's related to your definition of Position. How is it defined? EDIT: Oops, Narue beat me to it...

Member Avatar for Fbody
0
178
Member Avatar for ashrafu1

I really don't see anything wrong with the lines you have mentioned as suspects for the problem. They all appear to be properly-written output statements. Your issue is is actually an input issue. It's caused by the input stream getting corrupted. What is struct emp intended to represent? It looks …

Member Avatar for ashrafu1
0
183
Member Avatar for flyboy567

You'll need to adjust your output field width, and possibly your output alignment. Look into the options provided by [URL="http://www.cplusplus.com/reference/iostream/manipulators/"]the <iomanip> header[/URL].

Member Avatar for flyboy567
0
86
Member Avatar for Nicko_FaTe_

This is essentially what jonsca is telling you to convert your algorithm to:[CODE] int readRecords = 0; while (/*read first line of pet record*/) { //read and process remaining lines of current pet record; ++readRecords; //increment your record counter } for (int i = 0; i < readRecords; ++i) { …

Member Avatar for jonsca
0
134
Member Avatar for nightcracker

Well, considering that this is an error report, you may want to consider [URL="http://www.cplusplus.com/doc/tutorial/exceptions/"]try/catch blocks and exceptions[/URL]:[CODE] try { //some code //some code //ERROR throw errorType } catch (const errorType &e) { cout << "ERROR: " << e.what() << endl; }[/CODE]

Member Avatar for mike_2000_17
0
760
Member Avatar for Khoanyneosr

Yes, you can. It's called [URL="http://en.wikipedia.org/wiki/Common_Gateway_Interface"]Common Gateway Interface (CGI)[/URL]. I don't do anything with it though.

Member Avatar for Khoanyneosr
0
151
Member Avatar for android_sylph

What sort of project are you working on? There are several different concepts/objects you can apply the term "flag" to. In general, a "flag" is used to either indicate some state or trigger or prevent certain actions... You'll have to be more specific about your situation...

Member Avatar for Fbody
0
104
Member Avatar for iamcreasy

[QUOTE=iamcreasy;1505334]I also noticed something, [CODE]int main() { int x; int u = x; return 0; }[/CODE] This code runs perfectly fine on GCC 4.4.1 but doesn't on VCC, that comes with VS 2008 express edition. :S This is confusing![/QUOTE] That's a behavior that is compiler-dependent. I don't think there is …

Member Avatar for template<>
0
19K
Member Avatar for sarge66

So what exactly are you having trouble with? All that I see here is a wall of text containing 2 assignment dumps and a poorly-formatted (meaning hard-to-read) code dump. Unless I missed it, I don't see a good description of what your issue is and what you would like us …

Member Avatar for pseudorandom21
0
936
Member Avatar for hansoppa

[URL="http://www.daniweb.com/forums/announcement8-2.html"]I'm sorry, but we're not rent-a-coders.[/URL] If you would like help troubleshooting your own code, we'd be more than happy to help. Please post the relevant portions of your code and what your issue(s) is/are.

Member Avatar for rubberman
0
111
Member Avatar for yuyumerry

[URL="http://www.daniweb.com/forums/announcement8-2.html"]What have you done so far?[/URL] Solving this will require the use of 2-pair of nested loops... One pair handles the taper out to the right, the other handles the taper back to the left.

Member Avatar for yuyumerry
0
111

The End.