Hello everyone,i am reading Strustrups book and i found a spot in a example of his code which i don't fully understant.In this example we have a class Date which saves three variables,date,month,year.We have also a constructor which gives values to these variables by default.I will so you what i mean.
It means for example compare the zero value with the given value and if they are not equal return the new value?I am a litle bit confused.Can anyone help me? Thanks anyway.
It says if dd is non-zero, assign the value to d,
otherwise, assign the value of today.d to d.
So the net-effect of that constructor is this:
1. If you enter non-zero values for dd, mm, yy, assign these values to my guts.
2. Otherwise (dd, mm, yy are zero), default my guts to today's ymd.