Here is a C# .NET example that does it. You should be able to convert this to C++.
The bolded line below converts an integer to a string that contains the binary representation of the integer.
int intValue = 10;
string binValue = Convert.ToString(intValue, 2);
int intBackToOriginalValue = Convert.ToInt32(binValue, 2);
MessageBox.Show("bin: " + binValue.ToString() + Constants.vbNewLine + "int: " + intValue.ToString() + Constants.vbNewLine + "back" + intBackToOriginalValue.ToString());
See
Convert.ToString Method (Int32, Int32)[
^]. The Microsoft documentation shows that Convert.ToString can be used in C++ but does not provide an example.