Why can’t it be done like this?
#include<stdio.h>
#include<stdlib.h>
struct test
{
value z;
int x;
};
main()
{
enum value {a,b,c,d};
struct test come;
come.z = 2;
if (a == z) printf("they match ");
else printf("dont match");
}
Make the enum a typedef enum and place it above the struct.
Edit: fixed some minor typos.