dospy 51 Junior Poster in Training

you must provide CLEAR details if you want people to help you, what exactly is suppose your code to do?

sergent commented: . +7
dospy 51 Junior Poster in Training

or you can write the namespace contents and than wrap it all in the namespace u wanted

sergent commented: good idea +6
dospy 51 Junior Poster in Training

if this is your homework it means that you should know to do it, it's not our fault that you didn't learn when you have to.
we can't do that for you, we only can guide you to the right direction, not build the path for you

tkud commented: Well said +5
dospy 51 Junior Poster in Training

you don't have to buy a book, search on google the book name followed by PDF and you'll find pdf file(witch you don't have to download if you don't want) where you can learn from
ex:
"thinking in c++ pdf" - >http://www.lib.ru.ac.th/download/e-books/TIC2Vone.pdf

Azmah commented: Nice source +3
dospy 51 Junior Poster in Training

as Narue stated, you have to put all the default parameters at the end of the function declaration
as this

TwoDayPackage(const string&,const string&,const string&,const string&,
              const string&,const string&,const string&,const string&,
              double=0.0,double=0.0,double=0.0,int=0,int=0);

and for the too many arguments problem, you could use vectors..
ex:

TwoDayPackage(const vector<string>& strVector, const vector<double>& doubleVector, const vector<int>& intVector);

and you could use a define to trick the compiler to let you call it with one argument(treat rest like default)

#define TDPackage(x) TwoDayPackage(x, vector<double>( ), vector<int>( ))

edit: i've seen that the string parameters are related to each other, in this case you could create a special storage class and make it the function parameter like this

class StrStorage
{
public:
string m_Data1;
string m_Data2;
// ... etc
StrStorage(const string& nData1, const string& nData2) : m_Data1(nData1), m_Data2(nData2) { }
~StrStorage( );
}

// and than call the function this way
StrStorage strings("string 1", "string 2");
TDPackage(strings); // note you will have to modify the function to accept the StrStorage instead of a vector<string>
// or alternatively
TDPackage(StrStorage("string1", "string2"));// i won't use this one because you have to pass a lot of strings and that's waht you are trying to avoid
dospy 51 Junior Poster in Training
ConstructorX(string first):firstName(first)

basically, when you pass an argument to this function, your program will:
1)create an string object(first)
2)copy contents from the argument passed to the object
3)firstName will be initialized with the object(note: another copy activity)

now, if you use this way

ConstructorX(string &first):firstName(first)

your program will:
1)pass the argument directly to the function(skipping the overhead of creating and then copying another object)
2)firstName will be initialized with the object(note: another copy activity)

note that here, it passes the argument directly so it gives you the possibility to change it's value/contents in the function; for ex

#include <iostream>
void AddOne(int x)
{
    // x is a local variable
    x++; // increments the copy witch won't help us at all
    // x goes out of scope, the argument passed remains unchanged
}
void AddOne2(int &x)
{
    x++; // x is a reference to the argument, so, the argument increments
}

int main( )
{
    int nVar = 1;
    AddOne(nVar); // nVar value remains 1
    std::cout << nVar << std::endl; // prints 1;

    AddOne2(nVar); // nVar value increments to 2
    std::cout << nVar << std::endl; // prints 2;

    return 0;
}

if you still want your function to get the argument directly excluding the possibility to be changed just declare it as a constant reference

void AddOne2(const int &x)
{
    x++; // error, x is constant
}

so, your function will be faster if you use const references

const …
dospy 51 Junior Poster in Training

i am not sure what's the deal with all this unsigned/signed issues, my guess is that has something to do with the fact that after it reaches it's top/bottom range, a variable starts 'resetting' from the other side(if you understand what i mean)
anyway, if you want a function to check for if a variable is unsigned long(or any other type) you could try this:

template<class T>
inline bool IsUnsigned(T n)
{
    return std::string(typeid(n).name( )) == std::string("unsigned long");
}

note you must

#include <string>
#include <typeinfo> // in my compiler i can skyp this include, so i am not sure it is necessarily

edit: mike just posted a message by the time i was writing mine, you can follow his method since is better(cleaner and less time consuming)

dospy 51 Junior Poster in Training

that's not the name of the structure, it's an instance of and unnamed structure
basically when you declare a structure without naming it, you are not allowed to create any instances of it, thus the only way to create and instance is by putting names(separated by commas) after the struct declaration AND before the semicolon.
so,

struct{
int a; // note semicolon after declaration, not comma
int b;
char c;
} Check; // note here; it could be Check, Check2, Check3 etc before the semicolon

taking the address is rather simple from now; ex:

#include <iostream>

struct{
int a; // note semicolon after declaration, not comma
int b;
char c;
} Check;

int main( )
{
    std::cout << "Address of the unnamed structure instance named 'Check': " << &Check;
    return 0;
}

so, if you need to pass the address to the function, just use '&Check';

Fbody commented: Someone finally noticed. +13
dospy 51 Junior Poster in Training

more irritant thing is that what you're asking has less matter with c++ and more with logic, you should really try harder, it's not so complicated

Ancient Dragon commented: agree +17
dospy 51 Junior Poster in Training

i think your problem is that your header files does not have header guards: see this