S
subramanian
I saw the following code in Bjarne Stroustrup's 3rd edition of the book
The C++ Programming Language(NOT the special 3rd edition) - Pages228
and 229, related to static members.
I am giving the code only partly:
class Date {
int d, m, y;
static Date default_date;
public:
Date(int dd=0, int mm=0, int yy=0);
....
};
Date:ate(int dd, int mm, int yy)
{
....
}
Date Date::default_date(16, 12, 1770);
--------------------------------------------------------------
MY DOUBTS:
Here, does default_date(16, 12, 1770) call the constructor
Date:ate(int dd, int mm, int yy) ?
Is contructor called for static memebrs ?
The C++ Programming Language(NOT the special 3rd edition) - Pages228
and 229, related to static members.
I am giving the code only partly:
class Date {
int d, m, y;
static Date default_date;
public:
Date(int dd=0, int mm=0, int yy=0);
....
};
Date:ate(int dd, int mm, int yy)
{
....
}
Date Date::default_date(16, 12, 1770);
--------------------------------------------------------------
MY DOUBTS:
Here, does default_date(16, 12, 1770) call the constructor
Date:ate(int dd, int mm, int yy) ?
Is contructor called for static memebrs ?