siddhant3s 1,429 Practically a Posting Shark

Do you mean search records in a array of a struct?
It can be quite tough for us to help without knowing what your struct look like.
Post the code of your struct or anything what you have tried.
Searching a struct involves searching value of a key member of the struct array.

siddhant3s 1,429 Practically a Posting Shark

Rather than cin>>*x[index]; You should perhaps try: cin>>(*x)[index]; Precedence of [ ] is higher than * http://ocw.kfupm.edu.sa/user/ICS43153/Reference/C-Reference/C-Prog/section3_16.html
The the statement you wrote in the first post will be interpreted like this:
*(*(x+index))
As you can see, this has got no meaning.
Rather the code I just gave would be interpreted like this:
*((*x)+index)
which definitely have a meaning

siddhant3s 1,429 Practically a Posting Shark

>>firtly you divide the number by 10 . and then myltiply the number by 10.
It is lot better to use the modulus operator.

int N=85;
int Ones,Tens;
Ones=N%10;
Tens=N/10;
siddhant3s 1,429 Practically a Posting Shark

Didn't your professor told you about 2dim arrays?

const int MAX_LEN=20;//maximum length of eachname
char names[10][MAX_LEN];//create a 2D array to hold 10 names of length 20
int N=10;//
for( int i=0;i<10;i++){
cin.getline(names[i],MAX_LEN);

}

Reference to the function used in above code:
LIne 2:http://www.cplusplus.com/doc/tutorial/ntcs/
Line 5.http://www.cplusplus.com/reference/iostream/istream/getline/

As I know that you are a strict follower of your professor (I know this because of your thread on 'operator confusion'), I guess I should not tell you that standard C++ have a string class which simplifies the above process by million times.
One should always use c++ string rather than the Cstring(the one which is used in the above code) every time.
If you could divert some of your attention on standard c++ rather than following strictly what your professor told you( which is Ancient C++ actually) you could find the following article useful:http://www.bilmuh.gyte.edu.tr/gokturk/introcpp/icpp_strings1.html

jam7cacci commented: gives a good references +3
siddhant3s 1,429 Practically a Posting Shark

No, I really meant pow() function.
It is more versatile than sqrt().
You can use pow(N,0.5) rather than sqtr(N)

siddhant3s 1,429 Practically a Posting Shark

Please. Please
Don't use void main. http://cppdb.blogspot.com/2009/02/should-i-use-void-main-or-int-main-or.html
And yes, you are adding the squares of the integer rather than the square root.
To find the square root, you need to #include <cmath> and use the pow() function.http://www.cppreference.com/wiki/c/math/pow

siddhant3s 1,429 Practically a Posting Shark

Use the replace member function of the std::string.
Some reference may be found on the link below.
http://www.cplusplus.com/reference/string/string/replace/

siddhant3s 1,429 Practically a Posting Shark

Well, I guess the kid is ready to slash the mountain.
You basically want to write your own language.
There is a Bible for Compiler writing which called Dragon Book.
http://en.wikipedia.org/wiki/21st_Century_Compilers
It is a vast book. If you are dedicated to write a language, you should pay a price, i.e. Read the book.

Ancient Dragon commented: Very good information and link :) +36
siddhant3s 1,429 Practically a Posting Shark

ArkM, Read the first line of my post :-
In this case(where you need to initialize a structure to a arbitrary value), you need to write a constructor for that...
That means that I was talking in general. While my last sentence,("Note that all your members are c++ string, you don't require write a constructor explicitly. As the constructors of each string will initialize a null string(empty string)") was a specific discussion to the OP's problem.

>>The C++ DOES NOT garantee that null pointer value (NULL) to be zero
Who told you this. Not me at least.
What I said is that:
The NULL constant is same as zero in C++. (Ref: Stroustrup Homepage: http://www.research.att.com/~bs/bs_faq2.html#null)
Of course, a pointer holding a value NULL, when dereferenced, will NOT in general have a value zero.

int * p=NULL;
std::cout<<*p;//Will NOT print 0. Is a VERY BAD practice
siddhant3s 1,429 Practically a Posting Shark

In this case(where you need to initialize a structure to a arbitrary value), you need to write a constructor for that.
Constructors are part of Classes. But in C++, even structures can have constructors,destructor member function etc.. Loosely speaking, structure is as same as a class except that the members are public by default.
So you should perhaps write a constructor for your structures.
You may also overload the copy constructor, assignment operator etc etc etc.
But if you wanna do it the 'C' style( means not using any thing as constructor or destructor) you perhaps ask a C guru. I would suggest that you should make function which will take the array of singleIMEI and initiallisize it to zero(i.e. Null. Note that C++ guarantee NULL to be zero. So saying that the function should initialize it to NULL is same as saying the function initialize it to zero).

Note that all your members are c++ string, you don't require write a constructor explicitly. As the constructors of each string will initialize a null string(empty string)

siddhant3s 1,429 Practically a Posting Shark

>>22/7 is a poor approximation of pi.
Very right.
PI=3.14159265
22/7 =3.14285714
Your program is not doing good. What I meant to say is the aim of the program is not clear.
Moreover, you are using old headers, using void main.
Never use void main http://cppdb.blogspot.com/2009/02/should-i-use-void-main-or-int-main-or.html

I agree with Tux4life post about "Did you actually write this code ? "
As far as the Original problem is concerned sine can be easily calculated by the sin() function in cmath.
It takes radian as its measure.
Tux has already told you that.

siddhant3s 1,429 Practically a Posting Shark

Read http://www.parashift.com/c++-faq-lite/references.html from top to bottom.

>>What I still do not understand is: when you pass a pointer is it not like passing by reference?
Well, there is a clear line of difference. But at the beginning, it may feel a bit fuzzy.
read the homepage of stroustrup http://www.research.att.com/~bs/bs_faq2.html#pointers-and-references to get an insight. I am in a hurry right now. If you don't get anything, you can get back to us and ask again :)

siddhant3s 1,429 Practically a Posting Shark

>>Frankly speaking I haven't come across any such labellings myself.
It is then your bad luck, I guess!!
http://www.daniweb.com/forums/thread185887.html#3 This was one of my recent post I guess. But I have some of Narue posts too containing labeling and discretion for experts and non-experts.


>>@siddhant3s:
>>>>The 'Vet' is usually making a remark to :
>>>>1.Show that he knows
>>
>>I don't agree with this at all.
You may not. But that is true. Geeks/experts love others to know that they know. And I don't think it is wrong anywhere. They tend to show-off, and as Narue said try to "win" the Game.

Now I am surprised where is OP.:-/

siddhant3s 1,429 Practically a Posting Shark

>> int main(void) old syntax.
Preferred is int main() > quadraticFormula(a, b ,c, &x[0]); the last argument passed is same as passing x only. Since a name of array is pointer to first element.
Hence use: quadraticFormula(a, b ,c, x); >>void quadraticFormula(double a, double b, double c, double *totalResults)
I suggest you to use double totalResult[] instead of double *totalResults since it clarify that it is a array that your passing rather than a pointer( Actually it is the same thing. But a person, by looking the the prototype, which I mentioned is able to foretell that the function will use some array thing rather than pointer. He will be sure to pass a array rather than a simple pointer to int)

siddhant3s 1,429 Practically a Posting Shark

It is a input statement from the standard input device(the keyboard).
the Equivalent c++ code could be:

std::cin>>tside;

Or if you want a converter which shall convert C to C++ check this http://www.scriptol.com/scripts/ctocpp.php even this http://www.softforall.com/SoftwareDev/ToolsEditors/C_to_C___Converter08110221.htm

siddhant3s 1,429 Practically a Posting Shark

I would use a map from STL. Actually, map is a better data structure to be used in this case.
To the OP:
It is still not clear if you want to convert a Roman letter (like 'V' 'I' 'L' 'M') or a whole roman number( like 'IV' 'VII' ). The former is trivial but latter may require some skills.

siddhant3s 1,429 Practically a Posting Shark

Did anyone forgot: The Art of Computer Programing by Donald Knuth?

siddhant3s 1,429 Practically a Posting Shark

>>Like I was saying, why does it seem like some of the posts here are an ego-contest?
What is the harm?
Dani-web has a good ranking in various search engines. So its not only the member of Daniweb which are using it but some guests too. The "Vets" which you are calling may be the most experienced programmers. They tend to show their knowledge thinking that someone would be benefit from it. And it does help. And how does it matter if you get information from a person paying a simple cost of satisfying his/her ego.

>>Result 1
The 'Vet' is usually making a remark to :
1.Show that he knows
2.To let other knows
Which is a good thing I suppose. Moreover, the 'Vet' doesn't know how experienced OP is, so he finds safe to put the 'expert' comments. If OP understands it, good. If he don't, it is still not bad.
A good 'vet' however sieves he comments by labeling it as "Advanced" or "Intermediate" content.

>>Result 2
Don't agree at all. If the OP uses a search engine(Google in most of cases) he usually gains some knowledge about the subject. And this is reflected in his posts. It although, need a level to expertize and experience to tell if the OP has done some research or not. Good 'vets' have this skill.

>>Result 3
This is the responsibility of the OP( and sometimes, the mods) …

siddhant3s 1,429 Practically a Posting Shark

>>everybody knows some variable preceded by & is a reference
Sorry, But ampersand(&) serves two purpose in C++. Address-of operator and reference.
>>What I meant is the actual parameter represented by head is a pointer to a list of pointers
I don't know how can you conclude this by just looking at the given code. Moreover, there is nothing as list in c++( maybe u meant arrays)[spare me if you assumed the STL lists, as STL is not part of core language, the STL lists are only user defined type]

>>Moreover, a reference and pointer work in the same way internally.
Absolutely Right.

To the OP:
Like I said, the & serves two puposes in C++. Here it is used as to tell "this variable is a referene" while some other time it can be used as a address of operator. These are two separate things and one should not confused with it.( I assume that you were confused because you said "why I have to add & for address when......")

siddhant3s 1,429 Practically a Posting Shark

Where are the Data members?
I appreciate that you have modified complex number class to work here. This is a good example of code re-usability. But a Private inheritance in this matter would have been more eye-catching.
Well, The program has several typographical and syntactical errors.
Correct it!!.

siddhant3s 1,429 Practically a Posting Shark

>>head is a pointer to a list of pointers.
Wrong. head is a reference to pointer to CharNode.

To understand this(that why it is been passed by reference), just remember the basic pass by reference, i.e. pass by reference allows you to change the value of the parameter passed.
In this example. if you passed by value:
The compiler will create a copy of head(which is a pointer to CharNode) and assign some new memory location to it. Then, as soon as the function exits, the copy of head will be lost, and the newly created memory will be orphaned.
And you will not get the address of the newly created memory. The whole purpose of the funtion will be lost.
Remember, (loosely speaking) when you just need to read the value of parameter, use call by value and when you want to write a value to the parameters, use call by reference.(This remark is off-course not valid at all! But for you, at this stage, it will cause no harm in your programming. When you mastered the concept, learn something about const-correctness which will be a slightly advanced topic for you maybe).

siddhant3s 1,429 Practically a Posting Shark

may be in your neighborhood . but you see not all have grown up from there .
well it might give you a warning . may be a bad practice . but surely it compiles and fetches the right output .

Well, I don't do useless discussion. tux4life is absolutely right in saying that no standard compiler (standard compiler means complying to ANSI/ISO standard) can compile that code.
Now I don't want any posting regarding this matter. Any issues regarding this can be done through PM. This will make sure that you don't spread dirt here.
BTW, if you know any compiler compiling that code, please do tell me. I will never use it. Furthermore, it is not likely for you to argue when:
1:You are wrong.
and most importantly,
2:You know you are wrong.
Thats it!

PS: If you are interested( and ready to shed some money) you may like to see the C++ ANSI/ISO standards.

siddhant3s 1,429 Practically a Posting Shark

>there isnt any thing wrong with the code i have mentioned .
The person must be working with a 'magical' compiler. Since no standard compiler allow you to use iostream.h with namespaces. If you are using namespaces, you must use the iostream and not iostream.h
As far as your code is concerned, it is clear that you have not compiled the program. Don't worry, it is just fine. You are not expected to check and compile the code before posting. I am not blaming you but the OP.
BTW, I would surely like to ask the OP what compiler he/she is using because I have seen previously such code posted by him/her.

siddhant3s 1,429 Practically a Posting Shark

Passing by reference means the value of the parameter passed in may be changed during the function and that value will be reflected back in the calling function as well.

Well you are right. But there is often the case when passing-by-reference-to-const comes handy. It is usually the BEST method for passing big, user-defined objects.
the defination (in this context is):

Complex::Complex ( const double &real, const double &imaginary ){}

This serves two purposes: First, it make sure that the passing is by reference so you enjoy all the facilities references gives(like avoiding pointers). Secondly, the const makes sure that you get the abstraction offered by pass-by-value, i.e. you are sure that the function will not change any of the passed argument.
This is called const-correctness http://www.parashift.com/c++-faq-lite/const-correctness.html#faq-18.1

Anyway, the first code is obliviously not a good choice when working with C++. C++ creators have tried very hard so that the programmer can get rid of pointers where he wants to.

To dear adatapost:
It is not polite to quote everything that OP has posted. I know it is easy to press the reply button, but it sure increases the page size and thus decreasing the amount of data that can fit in one page.

siddhant3s 1,429 Practically a Posting Shark

>>You just use it like the sin function ...
Caution!! the Domain of arcsine function is from [-1.1]. I suppose the OP would be aware of this since he is dealing with it.
Also, return value is the principal value: -pi/2 to +pi/2

PS: I know all this must be in the reference of the asin given by Nucleon but I was cautioning since it was pointed "use as you use sine".

siddhant3s 1,429 Practically a Posting Shark

This code won't compile. You cannot use namespace with old c++ library (iostream.h).
Drop the second line of your code or use iostream instead of iostream.h

siddhant3s 1,429 Practically a Posting Shark

To the OP:
Read the vmanes post. It is the most relevant here. Technically, you are correct in defining printGrade as void. But as other pointed, the defination should have been also of a void return type as you function names suggests that it should PRINT a value rather than RETURNing it. So switch to void and change the return statement at last to a print statement( in C++, the cout).

Poor boy!

The boy is less poor than you are, he submitted his code in the code tags at least.

ha ha ha true , learn to read the errors and dig them , that is C++ life.

If you were saying all this to Ancient Dragon, alas you didn't got his point. He was emphasizing that the OP should be specific in what error he is getting. And one should respect the quality posts Ancient delivers.

tux4life commented: Nice post ! +1
siddhant3s 1,429 Practically a Posting Shark

I need the full code of how to do it

You would never get full code here.
Google is your friend. Here is a nice article here on Daniweb about generating Random Numbers:http://www.daniweb.com/forums/thread1769.html

Off-Topic
"Laughter Laughter, Laughing at my cries"

siddhant3s 1,429 Practically a Posting Shark

I know, but some operating systems like Unix and Linux aren't liking it if your program doesn't return an exit code ...

Wrong!
The fact that I told you is been defined by the language. It is implementation independent. It is a part of C++ standard to return a zero when no explicit return statement is encountered in main().

So, no matter what OS you use, if you are programming with a Standard compiler, you can skip the return 0; assuming that the compiler will put that for you.

BTW, even I use Linux. When I don't put a return zero, my program runs flawlessly.

Edit:: I posted this post before reading the last message. So the apology has been accepted. Never mind

siddhant3s 1,429 Practically a Posting Shark

return 0 is not mandatory when writing C++ main function.
Read Bjarne Stroustrup ( father of C++) homepage: http://www.research.att.com/~bs/bs_faq2.html#void-main
Here is the excerpt from the page:

In C++, main() need not contain an explicit return statement. In that case, the value returned is 0, meaning successful execution. For example:

#include<iostream>

	int main()
	{
		std::cout << "This program returns the integer value 0\n";
	}
tux4life commented: Nice to know ! +1
siddhant3s 1,429 Practically a Posting Shark

>>int co; // variable count occurences AKA co
you have not initialize it to zero. So it now contains some junk values. When you increment it will increment the junk values so the output won't be proper.
Write : int co=0; // variable count occurences AKA co Also, the question says that you need to implement it through a function. While you have not defined any function to do that.
You should define a function which takes two integer arguments and return a integer

int occur_digit(int n, int d)
{
    //the definition goes here

}
siddhant3s 1,429 Practically a Posting Shark

first of all always use the

tags while posting a c++ code.
The problem is that in your .cpp file, while assigning a value to SWDL::id, you are enclosing it within a namespace block. You cannot initialize a value in the definition. 
So the corrected code would be like this :
[B]the .h file:[/B]
[code=cpp]
namespace SWDL {
std::wstring id;
}

the .cpp file:

... 
..
...
SWDL::id = some std::wstring value;//this statement must be inside a function
...
...
...

Also, you don't need to put the whole qualifying name (namespace::member) when you have already told the compiler that you will be using the SWDL namespace.

siddhant3s 1,429 Practically a Posting Shark

>>I have a namespace in my header file and a variable declared in it.
Is this a .h header file? If yes then you may be perhaps compiling it separately which is not required.
say I have a header file my.h:

namespace my
{
    int a;
}

and I have my main.cpp as this:

#include<iostream>
#include "my.h"  //including the header file
int main()
{
my::a=56;
std::cout<<my::a;
}

Then I should just compile/link/run the main.cpp without compiling my.h separately.

siddhant3s 1,429 Practically a Posting Shark

Ancient hits the bulls eye.
Here is a excepts from Stroustrup's homepage: http://www.research.att.com/~bs/bs_faq2.html#null

Should I use NULL or 0?
In C++, the definition of NULL is 0, so there is only an aesthetic difference. I prefer to avoid macros, so I use 0. Another problem with NULL is that people sometimes mistakenly believe that it is different from 0 and/or not an integer. In pre-standard code, NULL was/is sometimes defined to something unsuitable and therefore had/has to be avoided. That's less common these days.

If you have to name the null pointer, call it nullptr; that's what it's going to be called in C++0x. Then, "nullptr" will be a keyword.

For the Q3, strictly speaking in C++, array do not always makes coding easier. std::vector makes coding lot easier than the traditional arrays.
Arrays are the feature of C which is been inherited in C++. If your on C++, try avoiding arrays and use std::vector.
In case the OP is not familiar with std::vector, he may do a little research on them as has to learn them one day or the other.

As far as OP's last question is concerned , I didn't understand it fully to make a remark.

siddhant3s 1,429 Practically a Posting Shark

There are a lot of GUI libraries available. wxWidget is a cross-platform free open-source library for developing native GUI
Another is GTK+(with the gtkmm port for C++), which I use is best if your platform uses GNOME as its desktop environment. Though, GTK is also cross-platform free open-source.
If you are on windows, you may use MFC but I don't suggest it.
Its better to go cross-platform with wxWidget.
Find some info about them and get back on us when you get struck

siddhant3s 1,429 Practically a Posting Shark

what are lyrics and artists? are they functions?
if yes, you should call them by lyrics() and artists()

switch (user_choice)
{
case 'A': lyrics() 
break;
case 'B': artists()
break;
}
siddhant3s 1,429 Practically a Posting Shark

[TEX]n=mt[/TEX] is the other way of writing that
[TEX]\frac{n}{m}=t [/TEX] where [TEX]t[/TEX] is a integer

it means that if you divide n by m, the division should leave no remainder.

>>we have to use if in these statement (m!=0)(m%n==0)(m<n) right??
yes


>>and we don't need to use loop, right??
No

You will have to use the loops for the first part of the question

siddhant3s 1,429 Practically a Posting Shark

I am surprised that the OP is not even participating in the discussion!
Anyway, if the OP bothers to see this thread, here is somewhat explanation from my side:
There are three loops in C,C++ namely while, do-while and for. Let this be clear in your mind that each loop, can be (theoretically) used instead of the other. So, why invent three loops in the first place? The answer may lie in 'comfort'. That is, each loop designed to help you in different situations. No loop is 'superior' than other.
So, in short, there are ADVANTAGES of each loop in its own domain.
The applications of each loop is too trivial and hence I am omitting it here.
Hope this helps!

siddhant3s 1,429 Practically a Posting Shark

There is a website I remember which helped me when I ran into the same problem.
It is called Google.com
You just have to type "File Handling in C++" as the search query and you will get more than your thought.
Please try it

siddhant3s 1,429 Practically a Posting Shark

You can of course return pointer to any object via function.
The syntax is pretty much intuitive:

returnType* myFunc(argType1 arg1, argTyp2 arg2.......)
//example
int* someFunct(int a, int b){}
char* someFunct(char* A, int Len)

Now, stand up dude, do some Google search and you will find much more than this.

>>How can i gain some information about ANSI/ISO c++ standard and the compilers that support it?
thanks again
By googling it. What info do you want. The complete standard? It is not free though. http://www.parashift.com/c++-faq-lite/big-picture.html#faq-6.13

siddhant3s 1,429 Practically a Posting Shark

Great
Python.org says that there is something like Tk which is native GUI toolkit for python. I use GTK+ on C/C++. So tell me which one should I use:
wxPython
pyGTK
TK
would I have any advantage using pyGTK (since I already know GTK+)?
Or should I use wxPython or TK. My prime objective is PORTABILITY and complete GUI

siddhant3s 1,429 Practically a Posting Shark

>>Personally i would definitely go for Dive Into Python, it is a long and very comprehensive book. I went back to one of its chapters just the other day to read up on unit testing and found it to be a great help.

Thats the type of answers I wanted: Thanks!

Finally, I found pyobfuscate http://www.lysator.liu.se/~astrand/projects/pyobfuscate/ that can give me a level of obfuscation. I would also be using something like bbfreeze if I ever write a closed-source software.
So, I am learning Python from Learning Python(starting chapters only) then will switch to Dive Into Python. And then perhaps Core Python Programming.

After reading these, I would switch to some advance books.
Is this right?

siddhant3s 1,429 Practically a Posting Shark

>>In the end though, there is no real foolproof way to prevent reverse engineering (even C++ code can be reverse engineered).

Do you know, how hard it is to reverse engineer it? I never found a decompiling tool that guarantees me to decompile the executable in th original source as this tool for python does http://www.depython.net/
(I have not tried this tool though)

I anyhow agree to your open source point. I am too a big OS/FSF fan.
Free softwares(free as in freedom of speech not as in free beer) have always fantasized me.
But, I am very keen about python. I am not just gonna learn it for fun. Or just to add one more name to the language-I-know list.
Thus, before submitting myself to the python world, I need to make sure I am not loosing anything out of it.

>>A list of python books online
I have a bigger list with me. What I need your help was to help me decide, which book will be right for me. I am trying for I am trying on
Core Python Programming, Learning Python, and Dive Into Python.
Which one of these do you guys recommend? another? why?
Thank You

siddhant3s 1,429 Practically a Posting Shark

>>Open-Source software is the way to go.
it is likely that I would be writing Open Source.
But Does that means that I shall loose my ability to write closed-source.
Don't you think its a heavy price to migrate to python?
I am sorry but I didn't like your answer. Actually this is no answer! :(

siddhant3s 1,429 Practically a Posting Shark

Well, Then how do you guys write proprietor(non-free) software with python?

Please tell something about books too( like jlm699 did, thanks).
I am trying on
Core Python Programming by Wesley Chun
Learning Python by Mark Lutz&David Asche
and Dive Into Python
Which ones for me? like I specified.

siddhant3s 1,429 Practically a Posting Shark

Well, first of all I will speak much so that you
guys can target my problem better.
Hello, I am a poster from the C++ forum. Hence, I am a well established
C++ programmer.
Now I want to learn Python.
First of all, should I? I mean, keeping in mind my skills in C++, should
I devote my time learning Python. I am in a believe that Python will
increase my productivity regarding writing software as my
development/maintainability will increase with Python as
compared to C++. I presume that learning Python will not
shatter my C++ knowledge. I am also in an impression that
after learning a good amount of Python, I would be able to
use C++ Python Combo to write ' the finest' applications.

So, I, as am running GNU/Linux, already have Python installed, went to Python
website and had a look at the Tut. So well so, I started liking Python.

My first major question is - what would be the best books for me. Considering
that:
1. I am a C++ Programmer
2. Want to master Python as well.
3. Am not afraid of reading.
4. But the books should be standard and well-written
5. Should provide me with deep knowledge of python.

Another Point that was snagging in my mind was:
C++ apps readily compile and I can distribute my softwares to …

siddhant3s 1,429 Practically a Posting Shark
arg << "AdjustSealevel.exe c d e " << pi + DO_Reading +
OtherVarsEtc ;// is a error
int secondArgument=5;
std::string thirdArgument="somevalue";
arg<<"AdjustSealevel.exe "<<pi<<" "<<secondArgument<< " " << thirdArgument;

as you can infer, use << and not +

Its like this:
try to cout all the arguments and test as they will appear on screen.

cout<<"AdjustSealevel.exe "<<pi<<" "<<secondArgument<< " " << thirdArgument;

Now when you are confirmed that these are the EXACT argument you want to pass, just replace cout with arg.

siddhant3s 1,429 Practically a Posting Shark

Also,

CENTS= 0.0307*GROSS*100;

CENT is int and you want it to contain float values!!
These thing will surely format your hard drive. So please: FIRST THINK, THEN WRITE.

siddhant3s 1,429 Practically a Posting Shark

Prototype of FEDTAX is different from the function call and function defination
prototype:

double FEDTAX(double, double&, int, int&);

defination:

double FEDTAX( double GROSS, int MARITALSTATUS)

perhaps you should change the prototype to

double FEDTAX(double, int);

Edit:Oops. Narue and I were editing simultaneously..... So it counts a useless post

siddhant3s 1,429 Practically a Posting Shark

Your problem is just like (actually same as) Project Euler problem 18 & 67 http://projecteuler.net/index.php?section=problems&id=18

I cracked the problem. I used down to up approach. Well I am feeling a lot lazy to type down my algorithm. But never mind. When we answer at Project Euler, we get access to a forum where we all discuss what all algorithm may have been possible. So here is the algorithm I used which I am copy/pasting from that forum. ( I have edited it so that it match your problem as we were given a different triangle)

31 Jul 2004 04:38 am 
mather    mather is from USA
Not sure if you all know this already, but starting at the base proves much superior in this problem... e.g.:


[B]1[/B]	6	4	8
[B]2[/B]	[B]9[/B]	4	7	3

If you reached '1' you would choose 9' over '2', so just add it to '9' to give you '10'.


2	2	7
[B]10[/B]	6	4	8
2	[B]9[/B]	4	7	3


Likewise, add the 9 to  6 and 7,to 4 and 8. this gives you:

2	2	7
10	15	11	15
--	--	--	--	--
This eliminates the last row....
Proceed like this up the triangle... whatever integer appears at the peak is the maximum sum.