cs quiz 5
write code to increment..
Date d = wed;
d =Day(int(d) + 1); // for class enum have to do this way.
for plain enumeration the compiler will promote(widening conversion) the value to int if needed.
or plain enum (ie. not class) compiler will promote (cast0 convert widening. d = Day(d+1);
Date dates[10]; // won't work without default constructor;
Date (int y = 2000 , int m=1, int d = 1); /// all 3 are optional..
Date d1;
default constructor for Date has no parameters...
Date::Date(){}
Date d = wed;
d =Day(int(d) + 1); // for class enum have to do this way.
for plain enumeration the compiler will promote(widening conversion) the value to int if needed.
or plain enum (ie. not class) compiler will promote (cast0 convert widening. d = Day(d+1);
Date dates[10]; // won't work without default constructor;
Date (int y = 2000 , int m=1, int d = 1); /// all 3 are optional..
Date d1;
default constructor for Date has no parameters...
Date::Date(){}

0 Comments:
Post a Comment
Subscribe to Post Comments [Atom]
<< Home