I\'m able to print the address and values of ints but not the chars of the union.Why is that so
#include using namespace std; union Endian
It's Undefined Behaviour to access field of the union with a type other than the last set one, at least in C++.
union
Whilst taking an address is legal in theory, that's not what the unions are for.