In looking through some legacy code, I came across this enum:
public enum cmdResults
{
cmdNotFound = 0,
cmdFound = 1,
cmdExit = 2,
cmdSuccess = 3,
cmdFail = 4,
cmdTimeout = 5,
cmdProcess = 6,
cmdAddTime = 7,
};
On noting the comma following the final enum member, I was stunned; I removed it, and, as expected, it still compiled. But why does it work with that final comma?
(And that's not mentioning the strange-to-me ordering of members; I would either put a new "cmdNothing" at index 0, or at least have "cmdFail" take that spot)