Alex Rivera | Logout

64 bit enum in C++?

Asked 2008-09-16T20:28:33.233
20

Is there a way to have a 64 bit enum in C++? Whilst refactoring some code I came across bunch of #defines which would be better as an enum, but being greater than 32 bit causes the compiler to error.

For some reason I thought the following might work:

enum MY_ENUM : unsigned __int64  
{  
    LARGE_VALUE = 0x1000000000000000,  
};
Edit
Report

1 Answer

0

In MSVC++ you can do this:

enum MYLONGLONGENUM:__int64 { BIG_KEY=0x3034303232303330, ... };

answered 2009-09-24T09:05:10.857

Your Answer