Is it possible...
Posted on 2003-02-21
Is it possible (in VC++ 6.0) to take an instance of an object, convert it to an integer (get the actual integer value), then take that integer and convert it back to the object?
num = (int)e1; // cast e1 to int
e2 = (Entry)num; // cast num to Entry
I know I can overload the = operator to assign e1 to e2, but I am just curious if this could be done. When c-casting (like above), most compilers will just warn you, but VC++ gives you an error. There has to be a way around this though - right?