-2

I have a decimal value stored in DWORD, and I want to convert it in simple way to hex to send it as argument to another function.

Is there any efficient function to do it or I have to write it myself?

I don't need to print it - I need the hex value in DWORD variable.

Piodo
  • 616
  • 4
  • 20
  • Possible duplicate of [Integer to hex string in C++](http://stackoverflow.com/questions/5100718/integer-to-hex-string-in-c) – Jongware Feb 21 '16 at 10:49
  • "I don't need to print it - I need the hex value in DWORD variable" is an idiotic requirement. The proposed duplicate makes it a string. – Jongware Feb 21 '16 at 10:50

1 Answers1

0

Try something like this:

int numToConvert = 15;
std::cout << std::hex << numToConvert << endl;

This should give you hex of 15.