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

Yes I think Visual studio 2010 has it

not really, MSVC 2010 has little support for c++ 0x
for example the syntax

for(int& x : <some vector/array/pointer>)

is not valid
same goes for 'constexpr' and many more..

for more vizit
http://blogs.msdn.com/b/vcblog/archive/2010/04/06/c-0x-core-language-features-in-vc10-the-table.aspx

dospy 51 Junior Poster in Training

describe your problem in more detail, anyway if i got it right, you can't do what you want cuz the compiler won't let you return a reference to temporary object(declared in the function body)

ps: your code isn't even valid so i can't tell exactlty what you really want..

dospy 51 Junior Poster in Training

i am not sure i understood what you want, if i got it right, the thing goes more complicated

this way you find ALL matches in the set

int matches;
for(j = 0; B[j] <= SS; ++j)
{
    matches = 0;    
    for(int k = j; k <= SS; k++)
    {
        if(B[j] == B[k])
            matches++;
    }
    if(matches > 1)
        cout << matches << " entries of the number " << B[j] << "in the set" << endl;

    matches = 0;
}
/*
note that this will output the pairs of numbers more than one time.
for example we have the set: 1, 10, 10, 10
when the main loop arrives at the first 10 it'll output
'3 entries of the number 10 in the set'
and than goes to the second one, so it'll print again and again...

if you want only one time you'll have to implement a function for erasing all elements equal to the parameter from the array
something like this:

void EraseEl(int a[], int el, unsigned int size)
{
// code here for erasing all elements equal with 'et' from the vector...
}
*/

from here you can adapt it to your code

dospy 51 Junior Poster in Training

your welcome

>> I've been staring at this code for so long that it was starting to not make sense anymore.
don't worry, happened to all of us(i guess), at least to me.
when i got so frustrated about my code failing i just have had a brake for my brain to think logical again; remember it's not good to code when you are angry or under pressure, this way you can't focus

dospy 51 Junior Poster in Training

line 108, again,

while (B[j] < SS)

try replacing with

for(j = 0; j < SS; ++j)

in that while basically you check if B[j](unassigned value) is < 23(pretty slim chances)
so almost none of the array elements get initialized, that's why your program is printing negative values, it just prints garbage

dospy 51 Junior Poster in Training

are you sure this loop is correct? what is it supposed to do?

for (j = 0; B[j] < SS; ++j)
{
    if (B[j] == B[j+1])
        ++M;
    cout << M << endl;
}

from generatebirthdays function
is this loop supposed to count the matching birthdays?
if yes, this is where your code fails, this loop doesn't look to me like doing something logically

edit: also you needn't declare function Swap, you could have used std::swap(as it does the exactly same thing)

dospy 51 Junior Poster in Training

my guess is that you put the

srand((unsigned int) time (0));

in a while, am i correct?, if yes, just move it first line after main.
remember, srand must be called ONLY ONCE(ofc, excluding the cases when you purposely call it more than one time) for the code to work as expected.
other than that i don't know what the problem could be, if this does not solve your problem, post your whole code so we can have a look at it

dospy 51 Junior Poster in Training

you could use a void pointer(ofc you'll have to add more interface to your class to eliminate error prone as void pointers are very dangerous)

dospy 51 Junior Poster in Training

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