Tag Archives: decimal

Another way to print hex value in C++

You can simply use the std::hex base format flag! This also works with oct and dec. #include <iostream> int main() { std::cout << "Value of 10 in hex: " << std::hex << 10 << std::endl; std::cout << "Value of 10 in dec: " << std::dec << 10 << std::endl; std::cout << "Value of 10 in […]

0  

How the overflow arises!

I looked up scripting languages and saw the unlimited precision capability of the integer format. It immediately made me think how overflows are handled in C! C language uses 16 bit to represent variable type int. Most significant bit is used to represent the sign  If the most significant bit is zero then the value […]

0