import Foreign import Foreign.C.String import Control.Monad main = allocaBytes 8 $ \ buf -> do poke buf ( 0x74637970 :: Word32) poke (plusPtr buf 4) ( 0x657275 :: Word32) peekCAString $ castPtr buf >>= putStrLn