
Make sure your switch statements always have a default label
A safe-to-use, long-lasting switch statement should always contain a default label in order to avoid hard-to-detect bugs such as the following: //Month.h fileenum Month { Jan, Feb, Mar, //…etc. Dec};//Month.cpp fileint daysInMonth(Month month) { int result = 0; switch (month) { case Jan: result = 31; break; case Feb: result