I am making a feature enhancement on a piece of code, and this is what I saw in the existing code. If there is an enumeration or declared structure, there is always a typedef later:
enum _Mode { MODE1 = 0, MODE2, MODE3 }; typedef enum _Mode Mode;
Simulation for structure:
struct _Slot { void * mem1; int mem2; }; typedef struct _Slot Slot;
Is it not possible to directly declare structures in enum? Why is there a typedef for something less like underscore? Is this a coding convention?
Please give good answers, because I need to add code, and if this is the rule, I must follow it.
Please, help. PS: For additional information, the source code is written in C, and Linux is a platform.
source share