4 ms·
Only with knowledge of platform AND compiler, though. Also these are C puzzles and casting pointers to incompatible types and dereferencing them is undefined b
by adsche 11y ago
Only with knowledge of platform AND compiler, though.
Also these are C puzzles and casting pointers to incompatible types and dereferencing them is undefined behavior. Using memcpy would indeed fix this according to e.g. [1].
[1] http://blog.llvm.org/2011/05/what-every-c-programmer-should-know.html http://blog.llvm.org/2011/05/what-every-c-programmer-should-... (section "Violating Type Rules")