Print data in HEX using C++
#include <iomanip>
for (int i = 0; i < size; ++i)
std::cout << std::hex << std::setfill('0') << std::setw(2) << (int)data[i] << " ";
std::cout << std::endl;
Written by Ashwin R Sidhalinganahalli
Related protips
Have a fresh tip? Share with Coderwall community!
Post
Post a tip
Best
#C++
Authors
Sponsored by #native_company# — Learn More
#native_title#
#native_desc#