enum {YES=1,No=0};
int main()
{
int i;
i=YES;
printf("%d",i);
}
works well.
enum B{YES=1,NO=0};
int main()
{
enum B i;
i=YES;
printf("%d", i);
}
also works well.
typedef enum {YES=1,NO=0} Boo;
int main()
{
Boo i;
i=YES;
printf("%d", i);
}
works too. Is there any difference? When is one of them preferred over another?