1,358 Posted Topics

Member Avatar for ShaRp codeR

[QUOTE=Arkrothe;1670009][CODE]while (principal = 0) { // Settings for, to show the decimal precision cout << fixed << showpoint << setprecision(2); // Calculations output cout << setw(2) << month; cout << setw(16) << principal; cout << setw(17) << interestPaid; cout << setw(18) << principalPaid; cout << setw(19) << principal << endl; …

Member Avatar for Nathaniel10
0
168
Member Avatar for Mona..

Please describe the problem you are having more clearly. What are you expecting it to do and how does its behavior differ from the expected?

Member Avatar for Mona..
0
360
Member Avatar for jeevsmyd

Any time you refer to a class that is written in a generic fashion, you need to provide a template argument(s) (the part between the "< >"). Your node pointers aren't declared properly. You need template arguments to indicate the proper type. Is is a pointer to a node conaining …

Member Avatar for mike_2000_17
0
134
Member Avatar for Zvjezdan23

No. You know the site rules. We're not here to do your work for you, we're here to guide you to your own success. You've been doing this long enough, you should know what the proper signature(s) for the main function is/are by now. Re-work your main() into the proper …

Member Avatar for Zvjezdan23
0
2K
Member Avatar for namratag

Additionally, the Debug and Release versions link to different libraries. If you compile a program in Debug mode, it will only work on a computer that has Visual Studio installed. To let someone else that doesn't have Visual Studio run your program, you have to compile it as a Release …

Member Avatar for Ancient Dragon
0
208
Member Avatar for sandman64

Based on the posted code I'm surprised it's only flagging "judge4"; it should be flagging 4/5 of your judge values every time. You may want to re-evaluate your algorithm a little. You really don't want to CalcScore until you've retrieved all 5 scores. As it stands now, you're re-calculating the …

Member Avatar for sandman64
0
139
Member Avatar for pendo826

[QUOTE=pendo826;1672383]i dont get what you mean there has to be a way to print out an array.[/QUOTE] There is, but you have to keep track of the size of the array manually, C++ doesn't do it for you. The method you've attempted would work with a std::vector, which is essentially …

Member Avatar for pendo826
0
2K
Member Avatar for flynismo

[QUOTE=ravenous;1672337]...* C++ [i]can[/i] be portable, but you have to work at it. With an interpreted language like Python, you almost get it for free.[/QUOTE] I think you'll have to clarify your thoughts on this statement. At its core, the C++ language is by its very nature highly portable. That's why …

Member Avatar for rubberman
0
201
Member Avatar for Mopikope

It lets you iterate through multiple items multiple times. One very common use is multi-dimensional arrays:[CODE] //#include the necessary headers #include <iostream> #include <cstdlib> #include <ctime> //declare needed constants const int ROWS = 10, COLS = 20; int main() { srand((unsigned)time(0)); //seed the RNG char Array[ROWS][COLS] = {'\0'}; //declare the …

Member Avatar for Mopikope
0
129
Member Avatar for Chuckleluck

I don't do any windows programming, so I don't know the actual API call, but I do know that there is a window property that controls that. To activate the maximize button, the "MaximizeBox" property needs to be set to "True". If you have a window style definition, you may …

Member Avatar for Fbody
0
168
Member Avatar for linhj

First, when posting code, please use [b][noparse][code]...code tags...[/code][/noparse][/b]. They preserve formatting and add Line Numbers making your code easier to read. Observe (with minor formatting corrections for readability and discussion):[CODE] #include<stdio.h> //Header file #include<stdlib.h> #include<time.h> #include<iostream> using namespace std; #define MAXROWS 10 //Define max rows =20 #define MAXCOLS 10 //Define …

Member Avatar for linhj
0
4K
Member Avatar for UNDER-18 FG

Well, this actually reads more like C code than C++ code, but we can still help you out. Would you elaborate on the errors you're getting? What compiler/IDE are you using? One thing I can see for sure is that your "date of birth" variable is an illegal identifier. Try …

Member Avatar for Fbody
0
175
Member Avatar for clide890

[QUOTE]I have not created a IPO chart since i tried doing the C++ part first to see if i was going to be write but i really don't know what I'm doing. I wouldn't even know how to start the IPO as i don't know what goes in the input …

Member Avatar for Fbody
0
360
Member Avatar for imolorhe

A bit can only hold 1 of 2 values (1) or (0). These can be interpreted as (on/off), (yes/no), (true/false), etc. One common use is to use bit shifts and the bitwise logicals to condense several of these types of values into a single variable to save space. For example, …

Member Avatar for daddymummy
0
227
Member Avatar for akhlakeng

[URL="http://www.daniweb.com/forums/faq.php?faq=daniweb_policies"]You write it first.[/URL] We aren't going to give you the code. You have to write it yourself. If you put forth a good-faith effort and have a problem with a particular part of your code, post a proper question; then you'll get something useful. I'll give you this though:[CODE] …

Member Avatar for akhlakeng
-4
356
Member Avatar for nuclear
Member Avatar for nuclear
0
704
Member Avatar for Labdabeta

I seriously doubt that will make your code easier to read. With the definition being split up like that it actually makes it harder to read because you have to bounce around to find all the relevant parts of the class definition.

Member Avatar for Labdabeta
0
184
Member Avatar for Chuckleluck

Is there a particular reason you put the BOOL in there? WriteFile() is a function. On Line 23, you're not calling the function, you're attempting to instantiate an object of the BOOL type called WriteFile. I suggest you remove the BOOL.

Member Avatar for Chuckleluck
0
208
Member Avatar for stereomatching

What kind of errors do you get? Please post the first few. I suspect that they have something to do with the conversion of an int* to another data type because in easyCopy() your parameter would be a [B]int * const &[/B], which is a pretty strange data type (a …

Member Avatar for mike_2000_17
0
169
Member Avatar for WrMadison667

Why are you trying to input to a constant? You can't. The whole point of a constant is that it's value remains unchanged throughout the execution of your program. I think you're going to have to clarify your intent.

Member Avatar for Fbody
0
142
Member Avatar for maybnxtseasn

No. By changing the type of the parameter, you've changed the syntax required to call it. Additionally, you've broken the code that is contained within it. You would have to swap the "arrow" operator '->' for the "dot" operator '.' Also, because it's now a non-const pointer to a non-const …

Member Avatar for Fbody
0
96
Member Avatar for l0v3csci

One thing that you need to remember is that not every location has all eight "neighbor" locations. For example, if you have a 3x3 array called "values", and you are at values[0][0], you will only have 3 "neighbors", they will be values[0][1], values[1][0], and values[1][1]. The remaining 5 "neighbor" locations …

Member Avatar for Fbody
0
8K
Member Avatar for DoubleZ

Do you know how to use functions? You could replace your evaluation with a function. Then, when you need an evaluation done, all you have to do is call the function. This eliminates the repetition by allowing you to re-use one piece of code. Perhaps something like this:[CODE]bool evalDigitSum(int valToSum, …

Member Avatar for DoubleZ
0
357
Member Avatar for _electricblue

If you're not sure what you want, how can we even begin to be? RE: Error on Line 70: From what I can see, the function is intended to receive a 2-dimensional array. However, when you pass Community[22][80] you are attempting to pass the single char that is found at …

Member Avatar for Fbody
0
900
Member Avatar for Adnan671

Change the arguments/parameters of your useMoney() function to references. That way, the modified values within the function's scope can get back to the calling scope.[CODE] #include <iostream> void someFunc(int unChangeableValue, int &changeableValue) { unChangeableValue++; changeableValue++; } int main() { int value1 = 0, value2 = 0; std::cout << "value1 is …

Member Avatar for Clinton Portis
0
295
Member Avatar for s_r_k

[QUOTE=s_r_k;1666550]I figured it out. Thanks.[/QUOTE] Next time, just leave your original post as is so that someone else can benefit from it if it applies to their problem. By "deleting" your original post, you've made this thread completely worthless to future readers.

Member Avatar for Fbody
0
350
Member Avatar for sunn shine

Did you read sundip's link? Towers of Hanoi is a mathematical puzzle. Read the link for more information.

Member Avatar for Fbody
0
149
Member Avatar for champu8

On most modern compilers, a long is a 32-bit integer value, the same as an int. If your compiler and/or system support it, I would consider a long long if you want a value that has more than 10 digits. With this type, you would now be limited to 19 …

Member Avatar for champu8
0
116
Member Avatar for Sunshine2011

[QUOTE][CODE]//create vector and pointer vector<int>*pVector(); vector<int>*pVector() { vector<int>*myvector=new vector<int>; return myvector; } //printing vector on the monitor via iterator void VektorPrint(); void VektorPrint() { vector<int>*PrintV=pVector(); vector<int>::iterator it; for(it=(*PrintV).begin();it!=(*PrintV).end();++it) { cout<<*it<<endl; } delete PrintV; //Frees the memory allocated with new) PrintV=0; //pointer to zero so program will crash, if some saves …

Member Avatar for Fbody
0
237
Member Avatar for hemj
Member Avatar for Fbody
0
2K
Member Avatar for falconmick

As I understand it, the [B]explicit[/B] keyword is only useful on a single-argument constructor, because they can be either implicit or explicit, but any other constructor is explicit. There are two (2) ways to declare an object. First, you can do this:[CODE] someType anObject(someValue);[/CODE] or you can do this:[CODE] someType …

Member Avatar for mike_2000_17
0
830
Member Avatar for JuloF26

This:[CODE] #import <iostream> #import <windows.h>[/CODE] is not correct. It should be "#[B]include[/B]"[CODE] #include <iostream> #include <windows.h>[/CODE]

Member Avatar for TPBarnett
0
624
Member Avatar for Zvjezdan23

[QUOTE=Taywin;1665532]Hmm.. You are still using syntax wrong... In line 23 & 43, do you want to declare a variable or a function? [CODE] float slope1((y2 - y1) / (x2 - x1)); [/CODE] If you want it as a variable, you should do it as [CODE] float slope1 = (y2 - …

Member Avatar for Fbody
0
319
Member Avatar for ntrncx

Function overloading is based strictly on the [B]arguments of the function[/B]. The compiler does not look at the return type of the function to determine overloading, it looks only at the number of arguments and the dataTypes of the arguments. If you have more than one version that has the …

Member Avatar for ntrncx
0
223
Member Avatar for James19142

The issue is integer division vs. floating-point division. Integer division divides an integer divisor into an integer dividend and produces an integer quotient. For example, if you have 11/3, integer division will produce a truncated integer result of 3 instead of the actual correct value of 3.6667, which is a …

Member Avatar for Fbody
0
161
Member Avatar for Zvjezdan23

[QUOTE=MonsieurPointer;1665334]You are trying to calculate your slope [i]before[/i] the user inputs values. You need to place int slope1 = ... and int slope2 = ... [i]after[/i] the code where values are stored in formula[n]. Also, declaring slope1 and slope2 is dangerous, because a float / double can turn out as …

Member Avatar for Fbody
0
111
Member Avatar for Isaac1024

[B]>>I want to use the * to display the output,[/B] Not entirely sure what you mean. Do you mean you want to use pointer arithmetic instead of array indices (not that there's really that big of a difference)? i.e. use [icode]std::cout << *(anArray + anIndex);[/icode] instead of [icode]std::cout << anArray[anIndex];[/icode] …

Member Avatar for Fbody
0
88
Member Avatar for Cross213

Is "Queue.h" a custom header that you wrote or are you attempting to use the queue that is part of the STL? It looks custom. What O/S and IDE are you using? If you are getting a linker error, it means that the linker can't find the implementation of your …

Member Avatar for Cross213
0
153
Member Avatar for Vermouth

>>[B]But instead of showing A, 2, ..., J, Q, K, it shows 1 to 13. How can I convert 1, 11, 12, 13 back to A, J, Q, K?[/B] You'll have to use conditionals (i.e. an "if" statement) and alter the output based on the value. [B]>>Can I make it …

Member Avatar for WaltP
0
394
Member Avatar for trantran

[B]>>Here F has access to only fct1 and fct2.[/B] No it doesn't. Because you used [B]private[/B] inheritance, it should only have access to the [B]private[/B] function R::C::fct_for_everyone(). R doesn't even have access to C::fct1(), C::fct2(), or C::fct3() because they have "higher" access than private (which technically doesn't exist, which essentially …

Member Avatar for mike_2000_17
0
161
Member Avatar for Thomas Tong

Part of your problem is that you have 6 members of the cd_detail struct (group, name, year, price, playtime, and costTotal), but you're only initializing 5 of them. [QUOTE][CODE]{"Alan","I love China",2010,53,500} //only 5 values here...[/CODE][/QUOTE] The value that you are failing to initialize is the value of costTotal. The other …

Member Avatar for vidit_X
0
237
Member Avatar for Will Gresham

I would check the matrix that's going into your assignment operator. What's happening is result gets returned to the calling scope as a temporary object. That temporary object then becomes the rhs argument for the assignment operator. It's possible that the temporary object is being destroyed before you are done …

Member Avatar for Fbody
0
157
Member Avatar for Zssffssz

It depends on how you do the user input. Simply doing this:[CODE] int userInput; cin >> userInput;[/CODE] will not work if the user enters any sort of char input (such as 'A'). It will corrupt the stream and mess up your program. To prevent this you'll have to get the …

Member Avatar for Fbody
0
155
Member Avatar for FRGT/10

Your function is defined as [CODE]int BinaryTree::getLeafCount(struct node *node) {[/CODE]Notice the [iCODE]node*[/iCODE] parameter... But your call is[CODE]b.getLeafCount();[/CODE]Notice the lack of an argument... Basically, because you didn't call it properly, you've unintentionally overloaded the function, but you don't have a definition/implementation of the overloaded version.

Member Avatar for homeryansta
0
312
Member Avatar for Kron

I seriously doubt that those are the only "commands" you can use. The more likely scenario is that you pulled that list from memory and those are the only ones you remember using before. This is evidenced by the randomness and you listing the cin and cout objects, but not …

Member Avatar for Narue
0
239
Member Avatar for Dani

[QUOTE=cscgal;74792]I've just started using [b]Folding@Home[/b], and I thought we might create a DaniWeb Folders team. For those of you who would like to be a part of our fight to cure diseases, by using your unused CPU time, please check out [url="http://folding.stanford.edu/"]http://folding.stanford.edu[/url] When setting up your client, enter [b]Team # …

Member Avatar for mitrmkar
4
2K
Member Avatar for bdubb24

This isn't really the forum for it (not real sure which one is), but I can help you with RAPTOR. What's the issue? @evstevemd: RAPTOR is an acronym, it stands for "Rapid Algorithmic Prototyping Tool for Ordered Reasoning". It's a tool developed by the US Air Force Academy to teach …

Member Avatar for fonzi
0
440
Member Avatar for ben1996123

From what I can see, you seem to have done your headers and implementation files correctly. The big problem i see is actually Lines 8-10 of main.cpp. Change the names of those variables/objects so that they aren't hiding the names of your classes with local identifiers. When you hide identifiers …

Member Avatar for ben1996123
0
560
Member Avatar for dospy

Iterators are essentially pointers. They are more powerful, and safer, than accessing an element directly through its index.

Member Avatar for dospy
0
182
Member Avatar for senator22

If you are getting a warning from your system, there must be something seriously wrong with your code. The better approach is to find out what part of your code is causing the warning and address the issue instead of just brushing it off like it doesn't exist.

Member Avatar for Fbody
0
109

The End.