Difficulty with assignment

My prof wrote this .h file of class Data that I have to implement.

class Date {
public :

// Dafault Constructor , set the date to the actual date
Date ();

// Constructor , pass the date in the form of dd ,mm , yyyy
// Note that the program crashes if the date is not valid ...
Date ( int d, int m, int y);
// Copy Constructor
Date ( const Date & to_copy );


// Getters
int year () const ;
int month () const ;
int day () const ;


// return the year from the date d, if d it not passed , it returns the year from now .
// Usefull to compute the age of a persone , where this is the person 's birth date
int yearsFrom ( Date d = Date ()) const ;

// return the date as a string in the form dd/mm/ yyyy
// Useful to print on the screen
std :: string str () const ;


private :
bool _isValid () const ;

int _year ;
int _month ;
int _day ;
};


I don't understand the parameter of int yearsFrom function. What does it means?
Is it possible to put an object equalto a constructor?
Is it possible to put an object equalto a constructor?

Yes. The equal sign provides assignment of a default argument. i.e. If yearsFrom() is called with no argument, the Date() constructor provides the current date (per the comments) and assigns the value to the argument d.

PLEASE ALWAYS USE CODE TAGS (the <> formatting button) when posting code.
It makes it easier to read your code and also easier to respond to your post.
http://www.cplusplus.com/articles/jEywvCM9/
Hint: You can edit your post, highlight your code and press the <> formatting button.

Sorry but i'm not expert! Thank you for your time and for your reccomandation!
Topic archived. No new replies allowed.