Subj : Re: enumerated variables - how to coerce them to anything else than an Int ? To : borland.public.cpp.borlandcpp From : John F\(dot\) Date : Mon Oct 10 2005 09:03 pm "R.Wieser" schrieb im Newsbeitrag news:434a4dc7$1@newsgroups.borland.com... > Hello all, > > I've got a structure (not designed by me) that consists outof a number of > longs. Several of it's members contain enumerated data, like { default, > yes, no }. > > I would like to make sure that I normally cannot put anything else in the > structure-member than what's permitted for it, but have hit a snag : I do > not seem to be able to enumerate anything else than Int's (the compiler's > default). > > My question : Is here a way to overrule that default setting so I can > create > enumerated longs or chars ? (My search on the Web did not turn up > anything > other than "it's not available") Hello Rudy, although some compilers allow long values to be stored as enums like enum { x = 1L, y = 1234567L }X; BUT: it is _not_ standard C99 (or C++ AFAIK...). So there is no way to tell if its still compatible... just try. Most compilers produce warnings on that. Some don't. Chars are not possible AFAIK... regards John .