I have used unions earlier comfortably; today I was alarmed when I read this post and came to know that this code
union ARGB { uint32_t colour; str
You could use unions to create structs like the following, which contains a field that tells us which component of the union is actually used:
struct VAROBJECT { enum o_t { Int, Double, String } objectType; union { int intValue; double dblValue; char *strValue; } value; } object;