while going through an example, i came across this:
Code:
customer::customer(char *firstname, char *secondname, int m , int d, int y)
:dateofbirth(m, d, y)
{
...;
}
My guess is that the code in red is a constructor for the class dateofbirth. This in turn lead to my conclusion that the class dateofbirth is a private member of the class customer. Further more, since it is written that
Code:
customer::customer(char *firstname, char *secondname, int m , int d, int y)
This would also means that in the main function, i am able to do sthg like this
Code:
void main(void)
{
...
customer customer1;
customer1(ssfccsh, ssfccsh, 1, 1, 2004)
}
Am i right?
Another doubt that needs clarification is that is it always true that const member function can only access const class member and static member function can only access static class member? If an object of a class is declared const, does it mean that all its class members are all const and any call to the member function in the class would be illegal?