i have to understand this code but i understand it, can you explain my line by line please?
class Date{
public:
Date(int inDay, int inMonth, int inYear);
int day() {return mDay;}
int month() {return mMonth;}
int year() {return mYear;}
void addDays (int inN);
private:
int mDay, mMonth, mYear;
};
Date::Date(int inDay, int inMonth, int inYear)
: mDay(inDay),mMonth(inMonth), mYear(inYear)
{
/*s'assurer que la date est valide*/
}
void Date::addDays(int inN)
{
/*ajouter un nombre de jours de la date courante*/
}
class Date{ // Starts the declaration of the class
public: // specifies that the next members are public ( so they can be accessed everywhere )
Date(int inDay, int inMonth, int inYear); // declares some member functions
int day() {return mDay;}
int month() {return mMonth;}
int year() {return mYear;}
void addDays (int inN);
private: // specifies that the next members will be private ( can be accessed only within the class or its friends )
int mDay, mMonth, mYear; // declares some data members
};
Date::Date(int inDay, int inMonth, int inYear) // implements the constructor
: mDay(inDay),mMonth(inMonth), mYear(inYear) // initializes the class data members
{
/*s'assurer que la date est valide*/
}
void Date::addDays(int inN) // implements the member function addDays
{
/*ajouter un nombre de jours de la date courante*/
}