+ 2
What does the colon operator do here?
In the birthday program class Birthday { public: Birthday(int m, int d, int y) : month(m), day(d), year(y) { } void printDate() { cout<<month<<"/"<<day <<"/"<<year<<endl; } private: int month; int day; int year; };
3 odpowiedzi
+ 1
this colon operator is used here in member intializer list . for more on member intializer list check out this https://www.geeksforgeeks.org/when-do-we-use-initializer-list-in-c/
+ 16
I think u forgot to make your birthday program public or provide us the link so we can try telling what colon operator do there
+ 7
Where’s the birthday program post code plz