R
randy1200
I've received the following:
typedef enum { 10Hz, 100Hz } myfreq_t;
So in my code, if I say:
myfreq_t f;
f = 10Hz; //f = 0, as expected
If I say:
myfreq_t f;
f = (myfreq_t)argv[1]; //compile error,
//invalid cast
Any ideas on how to match a char* to an enum value. I'm on Red Hat Linux,
if that matters.
Thanks,
Randy
typedef enum { 10Hz, 100Hz } myfreq_t;
So in my code, if I say:
myfreq_t f;
f = 10Hz; //f = 0, as expected
If I say:
myfreq_t f;
f = (myfreq_t)argv[1]; //compile error,
//invalid cast
Any ideas on how to match a char* to an enum value. I'm on Red Hat Linux,
if that matters.
Thanks,
Randy