Tag Archives: format

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  

Serializing Objects in JSON format

Serializing data/objects using XML is quite a standard way over the Web. But, XML has it’s own set of disadvantages owing to which I tried serializing objects in JSON format. It seems .NET has in-built support for doing the same. One simply needs to use the JavaScriptSerializer class available within ‘System.Web.Script.Serialization’ namespace. using System; using […]

0