Class Date

Hello every body

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*/
}

thank you very much
Last edited on
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
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*/
}

thank you Bazzy very much!
Topic archived. No new replies allowed.