+ 1

some help about this code subject

can someone lighten me up about something . in that line : month(m), day(d), year(y) {} if we arent gonna use that brackets then why are we opening them ????? https://www.sololearn.com/learning/1897/

1st Mar 2022, 1:40 PM
Lalala
Lalala - avatar
1 Odpowiedź
+ 1
If you were referring to the empty curly brackets, then it simply says that the constructor does nothing else but to initialize the class' data members by the given arguments, through the use of members initializer. Without the empty curly brackets as body delimiters, the constructor will be considered incomplete, a syntax error may be raised.
1st Mar 2022, 1:58 PM
Ipang