518 Posted Topics

Member Avatar for Raschoc

Prototype of FEDTAX is different from the function call and function defination prototype: [code=c++]double FEDTAX(double, double&, int, int&);[/code] defination: [code=c++]double FEDTAX( double GROSS, int MARITALSTATUS) [/code] perhaps you should change the prototype to [code=c++]double FEDTAX(double, int);[/code] Edit:Oops. Narue and I were editing simultaneously..... So it counts a useless post

Member Avatar for Raschoc
0
122
Member Avatar for maru2

Best resource that answer your question : [url]http://www.parashift.com/c++-faq-lite/newbie.html#faq-29.10[/url] In short: Just like the rest of your team

Member Avatar for Narue
0
119
Member Avatar for AlSal

Imagine a liked list with no data in it. You get pointer pointing to pointers.( chain of pointers) When declaring the pointers, always read from right to left [code=cplusplus] int * p; //Declare p a pointer to int int* *q;//Declare q as a pointer to, pointer to int int* * …

Member Avatar for siddhant3s
0
70
Member Avatar for bluebird

Your problem is perhaps about flushing the input stream. Read the sticky thread [url]http://www.daniweb.com/forums/thread90228.html[/url] . You though, have not fully described your problem. What I feel is, you may not be able to enter the 'marks for c' as the '\n' remains in the input stream and is entered automatically …

Member Avatar for tux4life
0
100
Member Avatar for abby2589

>can someone teach me how to use pointer in this program??i don't know if what i did in this program is correct. can you tell me how to use pointers here.thanks! Please Be specific. This is not a teaching classroom dear. You must read your text book and come to …

Member Avatar for tux4life
-2
153
Member Avatar for Gerlan

There is no char as 'v0' char constitute only one character. Multi-character constants are undefined by the language. So don't use them. While converting to int, only last character is read. That means: [icode]int i=(int)'ac' ;//will store the ascii value of c[/icode]

Member Avatar for Gerlan
0
208
Member Avatar for winrawr

Well, I don't suppose you should create thread like these. BTW, I use Emacs with g++ command line on my Linux Box. I also sometime uses Gedit( the default gnome text editor) with some plug in to make compilation easy.

Member Avatar for monkey_king
0
138
Member Avatar for erialclaire_238

Do something with arrays. Create a array and input the 5 location in it. Then run a loop and check for the given value. I mean, do SOMETHING man. We don't give free candies!

Member Avatar for erialclaire_238
0
319
Member Avatar for Vallnerik25

Look, you are on the right path. If you have already overloaded the operator= and operator+, you can use them in the definition of operator+= . Say the parameter of the += operator is aSimpleString.Then, the definition of += operator may look like. [code](*this)=(*this)+aSimpleString;[/code]

Member Avatar for Vallnerik25
0
143
Member Avatar for nitheesh.89

>>Hi .. I need a c++ program dealing with sales and marketing Hello, I need more than 24 hours a day to solve that!! Well, here's a TODO list: Read the Announcement and Sticky Thread :[url]http://www.daniweb.com/forums/announcement8-2.html[/url] and [url]http://www.daniweb.com/forums/thread78223.html[/url] Decide, what you want to do actually with your project. Cast your …

Member Avatar for siddhant3s
0
95
Member Avatar for trinity_neo

First convert your equation to a closed form. The close form clearly is [tex]\sum_{n=0}^{\infty}(-1)^n\frac{x^n}{n!}[/tex] Now construct a loop and evaluate it to desired [I][B]n[/B][/I] You would need a function to calculate factorial and powers.

Member Avatar for siddhant3s
0
174
Member Avatar for kavithabhaskar

Oh man!! Ancient Dragon would be snatching his hairs!! Look kavithabaskar, You are basically using recursions to avoid loops. Every series has Recursive form and a closed form(non-recursive)[Note that it is not possible for every series to have both forms]. Say, the series 1,2,3,4,5,6,7,8 has a recursive form as [TEX]A_{n}=A_{n-1}+1 …

Member Avatar for siddhant3s
0
159
Member Avatar for Takafoo

Takafoo, groom your basics. You don't even know how to use the modulo operator %. Now lets work upon how to guess if number is prime or not. What we gonna do is take the number and find its remainder when divided by numbers from 2 till the number-1. For …

Member Avatar for vmanes
0
124
Member Avatar for Traicey

>I have tried that but its not working I don't believe you. Show me the corrected code after all the correction what jenas suggested. And please for heaven sake, don't use void main(). It kills and is injurious to health. [url]http://cppdb.blogspot.com/2009/02/should-i-use-void-main-or-int-main-or.html[/url]

Member Avatar for Traicey
0
104
Member Avatar for eugene83

Make a class called[B] Point[/B]. Make two member function of type int called perhaps [B]X[/B] and [B]Y[/B]. You will have to make a two-arg constructor that will initialize the values of these data member. Write Two member functions accordingly which takes a array and its size and calculate the sum …

Member Avatar for siddhant3s
0
94
Member Avatar for abby2589

1.You are using C codes rather than C++.(The only thing in which you are using C++ is Console IO) 2.Non-Standard Headers. 3.Never use void main 4.Use fstream objects rather than fopen(). 5. [code] ch=0; ch=ch+c; ch=ch/2; c=c+ch; [/code] can be better stated as [code] ch=c; ch=ch/2; c+=ch; [/code] 6.Please specify, …

Member Avatar for Murtan
0
112
Member Avatar for cwarn23

Don't with Visual C++ MFC. Use some third-party platform independent libraries like GTK+ or wxWidgets. In that way, your code will be more portable.

Member Avatar for mitrmkar
0
143
Member Avatar for ellimist14

Say, you have 3 Arrays A[], B[], and C[], you want to sort all these according to A[]. What you should do is Apply the sort on A[] and while swapping the elements of A[], swap the corresponding elements of B[] and C[] along.

Member Avatar for siddhant3s
0
114
Member Avatar for Bretzel13

Hmm, Look: I use Linux, and I have firefox in it as my [I]favorite[/I] browser. Every time I need to open a URL, I call [icode]$ firefox URL[/icode] So, if you are saying cross-platform, your problem is merely to open a file in some application. What I suggest is, you …

Member Avatar for Bretzel13
0
169
Member Avatar for skitzo315

Yeah, Nucleon is right. What nucleon suggested is called implicit type conversion. The compiler in this case will convert the type of [COLOR="Green"]2[/COLOR] from int to double. Hence the division performed will be on decimals(rather than integers). To do a explicit type conversion, use the static_cast<type_name>(operand) For eg: [code=cplusplus] int …

Member Avatar for siddhant3s
0
90
Member Avatar for lllllIllIlllI

>what i have learned is that we donot use ".h" in VC2008 like : i use "iostream" not >with ".h" Most of the C-header files like (stdio.h, string.h, math.h,) are now comes with stripped [B].h[/B] and a [B]c[/B] added before there name. stdio.h --> cstdio string.h --> cstring math.h --> …

Member Avatar for lllllIllIlllI
0
240
Member Avatar for idb_study

Array of Pointers can be used to do fast sorting. For eg. If you want to sort a unsorted array of integer. You generally can use all sorts of algorithms on the int array. But it would be less efficient as the runtime head for moving the values of int …

Member Avatar for tux4life
0
154
Member Avatar for confused!

I am not showing-off, But just want to tell that how can STL come to your rescue. The program submitted by Haji Akhundov, Can be shorten to few lines only. [code]#include<iostream> #include<string> #include<algorithm> int main() { std::string orig, rev; std::cin>>orig; rev=orig; std::reverse(rev.begin(), rev.end() ); if (rev==orig) std::cout<<"Yes"; else std::cout<<"No"; } …

Member Avatar for hajiakhundov
0
269
Member Avatar for songweaver

Just to clarify what Lerner posted, you need to have [icode]if ( digit ==[COLOR="Green"][B]'2'[/B][/COLOR])[/icode] instead of [icode]if ( digit ==[COLOR="Red"] [B]2[/B] [/COLOR])[/icode] on lines 46,49,52 etc. (I hope you know why? If not, ask us back) Also, you must add a[icode] break;[/icode] after line 21 23 25 etc. Otherwise, all …

Member Avatar for siddhant3s
0
171
Member Avatar for etserrano

Well, what you want to implement is called multi-threading applications. It is OS dependent. So you may like to search a bit more about this.

Member Avatar for etserrano
0
160
Member Avatar for boydale1

>I do not see the point of reserving memory for a string when you already know >how much space to save First of all, your goal should be clear. Here is it: You want to create a string class which will wrap the conventional char[] so that the length of …

Member Avatar for boydale1
0
124
Member Avatar for venkitce

Yeah, why not: Yes, vectors are used in C++ They are part of the Standard Template Library. Now go and Use google.com to find out more. And further: Search for your answers before asking : Read this sticky thread :[url]http://www.daniweb.com/forums/thread78223.html[/url]

Member Avatar for NavidV
0
116
Member Avatar for songweaver

So, you want to go back to some line without a loop? It is not suggested. Beware, do not do this practice, but for the sake of your curiosity, there exists a [B]goto[/B] statement. Please do not use this in your everyday life. There is a good example on implementing …

Member Avatar for MosaicFuneral
0
276
Member Avatar for superpc2525

>Can any one help me to improve it (by adding graphics) and making code short. No we cannot. We don't give away codes. What you can do is, [B]ask more specific questions[/B].

Member Avatar for siddhant3s
0
288
Member Avatar for daino

So, you are a new bie in C++. You are just doing console programming right now. Right? I mean all sought of Black& white interface. You want create a window-like GUI. Hmm, Well, there are lot of GUI library out there. You can try anyone you want. But the choice …

Member Avatar for xyzt
0
109
Member Avatar for ScienceNerd

[code]int age; cout << "Enter your age" << end1; cin >> age; [/code] Ha Ha Ha Look at the second line end1; it should be [icode]endl [/icode]not [icode]end1 [/icode]

Member Avatar for charleen
0
116
Member Avatar for walom

Don't use such a adhoc method. Use the STL method like this: [code] #include<sstream> inline std::string stringify(double x) { std::ostringstream o; if (!(o << x)) cou<<"Bad Conversion"; return o.str(); } //Heres is how to use it: string s1("123456"); int number=stringify(s1); cout<<number; [/code] For more, refer :[url]http://www.parashift.com/c++-faq-lite/misc-technical-issues.html#faq-39.2[/url]

Member Avatar for siddhant3s
0
72
Member Avatar for Duki

Have you defined your own copy-constructor, or using the default one? (que1.IsEmpty() != true && que2.IsEmpty() != true ) is depreciated. Use ( !que1.IsEmpty() && !que2.IsEmpty() ) vmanes is rather right. you must construct a else case also. Another point to note is, you should avoid recursions as far as …

Member Avatar for Duki
0
179
Member Avatar for JameB

You should perhaps read those two value in two strings variables. And then write your own add function which would find there sum.

Member Avatar for arshad115
0
161
Member Avatar for CPPRULZ

Look at line 34 furlong.h [icode](class Kilometer& kilo)[/icode] You are using [B]Kilometer[/B] here. Right? Now just tell me, have you told your compiler before that something called [B]Kilometer[/B] exists? No. So, what to do? Simple, you need to tell your class furlong that there exists something called Kilometer by declaring …

Member Avatar for siddhant3s
0
118
Member Avatar for disc

Daily in the morning, chant out this line " Its better to detect error at compile time than at link time or run time." And this is the whole key to const-correctness, this is what you call it in technical terms. Read:[url]http://www.parashift.com/c++-faq-lite/const-correctness.html#faq-18.1[/url] const-correctness basically ensure type safety. It should be …

Member Avatar for disc
0
183
Member Avatar for Seapoe

[B]I've read the thread on homework help and am not here asking for someone to do my program.[/B] I guess you didn't read about posting your code in the code tags:[url]http://www.daniweb.com/forums/misc-explaincode.html[/url] [B]I decided to use a linked list with this type declaration[/B] This is a Node of the linked list, …

Member Avatar for monkey_king
0
109
Member Avatar for fourstar

C++ FAQs by Marshal Cline is a good, free resource. If you are a absolute biginer you must read "The Correct C++ Tutorial" [url]http://home.no.net/dubjai/win32cpptut/html/[/url] Thinking in C++ by Bruce Eckel is a nice book(free online) You may visit the Sticky forum about C++ books [url]http://www.daniweb.com/forums/thread70096.html[/url]

Member Avatar for tux4life
0
335
Member Avatar for jayli27

I am still confused why do you want to do this. I just can wonder that probably your implementation lacks a C++ compiler and hence you want to convert the C++ code to C. Well, the very first compiler(cfront), made by Bajane Stroustrup actually did this thing only. It converted …

Member Avatar for siddhant3s
0
366
Member Avatar for erialclaire_238

Read your text book!! I mean please at least TRY. skatamatic, said use a for loop. Go search what is a for loop etc. I will elaborate a little. Use a for loop to accept all number in a array. Use another for loop to check weather each of those …

Member Avatar for skatamatic
-1
98
Member Avatar for crewxp

Umm, Well I just know don't why would I use the scanf() to read out a character when I have the pretty getchar() in hand. [code] char a a=getchar(); [/code] While another thing to keep in mind (this is for you, the thread starter) is that all these functions are …

Member Avatar for siddhant3s
0
296
Member Avatar for joejoe55

>Can you add a semicolon after MYVAR(DLLINFO, DllInfo), like Look at macro definition, the macro itself is adding a semi-colon. Adding a semicolon will actually add two semicolons. @joejoe55 Yeah, you should send the code. If is huge, just attach it, otherwise paste it here.

Member Avatar for mitrmkar
0
192
Member Avatar for redhotspike

What is this >>> `NodePointer nPtr = new Node(dataValue);` what is NodePointer? I didn't see it declared in any of your code!

Member Avatar for redhotspike
0
184
Member Avatar for monkey_king

are you sure you have placed a #endif after the end of TemplatedFoo.h? if not, definately your code can provide you with trouble

Member Avatar for StuXYZ
0
848
Member Avatar for mmeyer49

Please use a proper loop( a do-while should do in this case) Please use switch case instead of if( it was made for situation like this) Please do not use system() (it is unportable) And as stilskin said: if(select = 1) and if(select == 1) has a hell lot of …

Member Avatar for r.stiltskin
0
189
Member Avatar for Mossiah

Well, your do-while loop is absolutely fine. The problem you are suffering is that: 1. You are not initializing the array new_string when you are using it. Add a [icode]for(int i=0;i<256;(new_string[i]=0),i++);[/icode] before the [icode] int x = strlen(your_string)-1;[/icode] in definition of ReverseString(). 2. You are not flushing the input stream. …

Member Avatar for vmanes
0
111
Member Avatar for jeevsmyd

It is not completely his fault though, I know the schools in India, they teach "Ancient" C++. But I completly agree with Narue's first comment. You have a internet connection. So go and get "Decent Book" (I told you about Thinking in C++ by Bruce Eckels). Be with the Standard …

Member Avatar for Narue
0
169
Member Avatar for tux4life

This is called, to kill a Mosquito with a Bazooka. Why did you went into the char thing. Look at ArkM's code, its neat, decent and much faster. And does almost the same work which you were trying to accomplish. BTW,[icode] char chr_digits[] = {'0', '1', '2', '3', '4', '5', …

Member Avatar for tux4life
0
137
Member Avatar for vishy_85

Here is a platform independent solution:[url]http://steinsoft.net/index.php?site=Programming/Code%20Snippets/Cpp/no4[/url]

Member Avatar for siddhant3s
0
84
Member Avatar for tpetsovi

[B]The last funtion IsPrimeNumber () is giving me an error that states ..."Local Function definitions are illegal"....can someone please tell me why?[/B] This is because you didn't closed the function definition of [B]void ConvertTotalSeconds (void)[/B] (i.e. you didn't put the closing [B]}[/B] while ending the definition of [B]void ConvertTotalSeconds (void) …

Member Avatar for kbshibukumar
0
187

The End.