#include <iostream> #include <cstring> int main(){ char x[6] = {0}; int y = 0x48656c6c6f; int y2 = 0x656c6c6f; std::cout << (y == y2) << std::endl; error; std::memcpy(x, &y, sizeof y); for (char c : x) std::cout << c;}
Standard input is empty
prog.cpp: In function ‘int main()’: prog.cpp:7:13: warning: overflow in implicit constant conversion [-Woverflow] prog.cpp:12:5: error: ‘error’ was not declared in this scope
Standard output is empty
The brand new service which powers Ideone!
Widget for compiling and running the source code in a web browser!