VS2010 compiles the posted code (except that main() must return a value).

Your code is so C-ish. Why not graduate to C++? Rather than a union of pointers you could use inheritance (two (or more)...