Are you sure you actually need to do any conversion?
consider this:
1 2 3 4
int a = 0xD431;
int b = 54321;
cout << "a: " << a << endl;
cout << "b: " << b << endl;
Output:
a: 54321
b: 54321
a and b are unrelated integer values.
When the value is output, we see it in decimal.
But internally they are both stored in binary. There is no need to explicitly convert anything in this example.
By the way, the original code has an uninitialised pointer data_1. Since this does not point to a valid address, attempting to assign data to it will give rise to unpredictable results.
The words hex and decimal have no sense when applied to variables. They have meaning only when you are printing variable or reading it - i.e. when you interchange value with user.
Here are functions like "itoa" which allow convert data shortly enough. "sprintf" and "sscanf" also will do much good for complex formatting.