#include // ... std :: string s_num = "5500" ; int num = std :: stoi ( s_num , nullptr , 16 ) ; // num = 0x5500