Prev: sizeof: Why parentheses needed when used with data types (when not required with variables)
Next: Custom generic container class
From: krishna on 8 Nov 2009 21:42 int main() { union my_union{ int i; float f; }; my_union u; u.f = 2.0; std::cout << u.i; } why is int casted value of u.f not given? (the start address is the same for all the members). -Krishna. -- [ See http://www.gotw.ca/resources/clcm.htm for info about ] [ comp.lang.c++.moderated. First time posters: Do this! ] |