Training, Open Source
computer languages


PerlPHPPythonMySQLApache / TomcatTclRubyJavaC and C++LinuxCSS 

Search our site for:
Home Accessibility Courses Diary The Mouth Forum Resources Site Map About Us Contact
ENUM  nested within a struct defined within C++

Posted by nano (nano), 21 September 2006
Hi ,

Can anyone see whats wrong with this  I have my enum types defined here and when i call them i get a syntax error message at compile time

struct fptok {
   struct d_rep rep;
   union {
       double t_double;
#ifdef __LP64__
       long t_int;
#else
       d_int_t t_int;
#endif
       int t_bool;
       enum operatortype t_oper;
   } u;
   enum {
       tt_double,
       tt_int,
       tt_bool,
       tt_oper,
       tt_unknown
   } t;
};


switch ((*pfp)->t) {
            tt_oper:


The error  is complaining that tt_bool  etc aren't defined ...

Any ideas why C++ compiler doesn't like this ..






This page is a thread posted to the opentalk forum at www.opentalk.org.uk and archived here for reference. To jump to the archive index please follow this link.


WELL HOUSE CONSULTANTS LTD.: Well House Manor • 48 Spa Road • Melksham, Wiltshire • United Kingdom • SN12 7NY
PH: 01144 1225 708225 • FAX: 01144 1225 707126 • EMAIL: info@wellho.net • WEB: http://www.wellho.net • SKYPE: wellho