casting - is there any easy way to convert int type to enum type in c language? -


how cast int enum in c?

enum b; int c;  b = (a)c; 

it doesn't work. error message 'a' undeclared

(in gcc)

as seem know declaring variable, enum types must prefixed word enum.

b = (enum a)c; 

Comments

Popular posts from this blog

commonjs - How to write a typescript definition file for a node module that exports a function? -

openid - Okta: Failed to get authorization code through API call -

thorough guide for profiling racket code -