Possible Duplicate:
C++: Iterate through an enum
I have following enum in c++;
typedef enum
{
APP_NONE = 0,
APP_SESSION = 0x80000001,
APP_TITLE = 2,
} APP_TYPE;
I am writing a test function, which accept a string, get related integer, such as: getEnumByString("APP_NONE") = 0; or vice verse getEnumString(0)="APP_NONE".
Is it possible and how to finish it?