Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
Union and possible undefined behavior
//Microsoft (R) C/C++ Optimizing Compiler Version 19.00.23506 for x64 #include <iostream> union U { int i; float f; }; int f( int* pi, float* pf ) { int r = *pi; *pf = 3.14159; return r; } int main() { U u; u.i = 1; std::cout << f( &u.i, &u.f ); }
run
|
edit
|
history
|
help
0
Strings
Zero length array as a class member
trying to find if reinterpret_cast preserves calling convention
VS2013 hello world includes
MSVC_example_fscanf_s_and_chars_wchars
std::function ambiguity vc++
VC++ fail
variable template not supported
Catching divide-by-zero with /EHc
MSVC ignoring unknown attributes