J
Jorn Ronnow
I'm a bit confused here, since the help in M$ Visual Studio 2005 states the
syntax for enum as:
enum [tag] [: type] {enum-list} [declarator];
So, it would be possible to write:
enum Protocol_t : unsigned char { ICMP = 1, TCP = 6, UDP = 17 };
struct IPHeader {
// ...
Protocol_t Protocol;
// ...
};
It sounds like an M$ specific extension to me, but it's not listed as such
in VS2005's help section "Microsoft Extensions to C and C++". On the other
hand, it's not included in Schildt's "C++: The Complete Reference" (4th ed,
2003).
cul8r
/Jörn
syntax for enum as:
enum [tag] [: type] {enum-list} [declarator];
So, it would be possible to write:
enum Protocol_t : unsigned char { ICMP = 1, TCP = 6, UDP = 17 };
struct IPHeader {
// ...
Protocol_t Protocol;
// ...
};
It sounds like an M$ specific extension to me, but it's not listed as such
in VS2005's help section "Microsoft Extensions to C and C++". On the other
hand, it's not included in Schildt's "C++: The Complete Reference" (4th ed,
2003).
cul8r
/Jörn