Coming from a Java background, I find C++\'s enums very lame. I wanted to know how to write Java-like enums (the ones in which the enum values are objects, and can have attr
May be this is what you want --
#include using namespace std; class Planet { double mass,radius; Planet(double m, double r) : mass(m) : radius(r) {} public: static const Planet MERCURY; void show(){ cout<
This is just a small code, Im sure you can modify this to suit your needs..