fork(1) download
  1. #include <iostream>
  2. #include <iomanip>
  3. #include <sstream>
  4. #include <string>
  5. #include <algorithm>
  6. using namespace std;
  7.  
  8. int main() {
  9. int parameter=10;
  10. std::stringstream ss;
  11. unsigned char buffer[10];
  12.  
  13. ss << std::hex << std::showbase << parameter;
  14. const string &s=ss.str();
  15. *copy (s.cbegin(), s.cend(), buffer)='\0';
  16. cout << buffer<<endl;
  17.  
  18. return 0;
  19. }
Success #stdin #stdout 0s 3456KB
stdin
Standard input is empty
stdout
0xa