The following C++ program takes values of primitive C++ types (e.g. int, double and so on) and converts them into hex and binary representations. This is a simple and useful tool for examining how actual low-level data is represented by the compiler and CPU.
Once compiled, simply provide as arguments the name of the type following [...]
Hex and Binary of Primitive Types
June 14th, 2009Cost of gettimeofday
March 13th, 2009What is the cost of calling the Linux/Unix system function gettimeofday()?
Goto postConvert memory regions to strings
March 13th, 2009We often need to display the exact bytes stored within a region of memory, or we might be interested in the byte representation of a variable. Typically we want such things during debugging, or trying to understand binary based protocols.
Bytes are best displayed in hexadecimal notation (hex). So we require a function that takes a [...]