Original Post
Hello I am writing a function to save a bitmap, and i am having a problem with file io I have simple code: std::ofstream OutBin("test.bin", std::ios_base::binary | std::ios_base::out); OutBin << 0xDEADBEEF; But right now that writes a 10 byte long file with contents "3735928559". I would like to know how I can get it to write a 4 byte long file with hex DEADBEEF.