+ 2

Do order matters ? In this code

class Birthday { public: Birthday(int m, int d, int y) : month(m), day(d), year(y)//here { } void printDate() { cout<<month<<"/"<<day <<"/"<<year<<endl; } private: int month; int day; int year; };

11th Mar 2018, 5:03 PM
Jay Jay
Jay Jay - avatar
1 Answer
+ 3
No. You can assign in any order or skip an place assignments in the {}.
11th Mar 2018, 5:31 PM
John Wells
John Wells - avatar