What's the purpose of the 1+1, 1+2, etc.. why not just do 2,3,4......??Code:enum tx_op { P_TX = 1, PU_TX = 1 + 1, RT_TX = 1 + 2, GET_TX = 1 + 3, PUT_TX = 1 + 4, };
This is a discussion on Why do the enum values this way?? within the C Programming forums, part of the General Programming Boards category; Code: enum tx_op { P_TX = 1, PU_TX = 1 + 1, RT_TX = 1 + 2, GET_TX = 1 ...
What's the purpose of the 1+1, 1+2, etc.. why not just do 2,3,4......??Code:enum tx_op { P_TX = 1, PU_TX = 1 + 1, RT_TX = 1 + 2, GET_TX = 1 + 3, PUT_TX = 1 + 4, };
Yeah, it looks like cruft. It could have been written as:
Code:enum tx_op { P_TX = 1, PU_TX, RT_TX, GET_TX, PUT_TX, };
C + C++ Compiler: MinGW port of GCC
Version Control System: Bazaar
Look up a C++ Reference and learn How To Ask Questions The Smart Way