Possible Duplicate:
Easy way to use variables of enum types as string in C?
Is this possible to customize printf?
is it possible to print own defined typedef in more convinient way? Here is example:
typedef enum {
On,
Off,
Unknown
} State;
State st;
st=getState();
printf("State is:%??",st);
I want to be displayed "State is:On | Off | Unknown"