C++ tips: using external libraries in gcc project

sudo apt-get install libboost-all-dev
#include <iostream>
#include <boost/thread.hpp>
#include <boost/bind.hpp>
int main()
{
}
g++ -o test_boost test_boost.cpp -lboost_system
int main()
{
unsigned int arr[5] = { 0x05, 0x04, 0xAA, 0x0F, 0x0D };

std::cout << boost::format("%02X-%02X-%02X-%02X-%02X")
% arr[0]
% arr[1]
% arr[2]
% arr[3]
% arr[4]
<< std::endl;
}
05-04-AA-0F-0D

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store