Seriously stupid question

No, seriously, it's probably the stupidest question in a good while. I'm not a C/++ programmer; I can read enough syntax to get by but for the most part I just translate code examples from specification docs from C or C++ into VB or Perl (and only with a lot of help from Google and a couple of old C++ reference manuals).

I'm working on a TLS 1.0 implementation from RFC 2246, and I've run into the following line of sample code:

enum { null(0), (255) } CompressionMethod;

I don't have the faintest idea what (0) at the end of the null means or what the (255) represents at all, and I don't understand why there aren't any entry names in this enumeration; my best guess is that this line of code creates an enumeration with 0-254 members that have a value and no name. Google seems to have an awful lot of trouble parsing a search string including parentheses, and my manuals are geared more toward finding the syntax for what you want to do than finding what you want to do if your syntax reads such-and-such.

I'm also aware this isn't strictly C++ code, but I'm hoping it's close enough. Thanks very much if you've read this far.
Last edited on
Yes, that there is non-standard syntax. (It shouldn't compile.)

It appears that whatever extension it is allows you to declare the compression method to have only two values: zero and 255.

At least, that's my best guess..

Good luck!
Topic archived. No new replies allowed.