Board index » cppbuilder » Hex to bin

Hex to bin


2006-08-05 08:56:24 AM
cppbuilder70
Hello everyone,
Can anyone translate the following delphi code to Borland C++ code?
ULONG nPts63to32;
ULONG nPts31to0;
AnsiString strTemp;
strTemp.Format("0x%08X%08X", nPts63to32, nPts31to0);
Thanks in advance,
Bastiaan Wit
 
 

Re:Hex to bin

Bastiaan Wit wrote:
Quote
ULONG nPts63to32;
ULONG nPts31to0;
AnsiString strTemp;
strTemp.Format("0x%08X%08X", nPts63to32, nPts31to0);
strTemp.Format( "0x%08X%08X", ARRAYOFCONST( ( nPts63to32, nPts31to0 ) ) );
// Note the double parentheses.
Jonathan
 

Re:Hex to bin

"Bastiaan Wit" < XXXX@XXXXX.COM >wrote in message
Quote
Can anyone translate the following delphi code to Borland C++ code?
That is not Delphi code. That is C++ code.
If you are referring to just the parameters of Format() specifically, then
use ARRAYOFCONST, like Jonathan suggested. Otherwise, switch to using
sprintf() instead:
strTemp.sprintf("0x%08X%08X", nPts63to32, nPts31to0);
Gambit
 

{smallsort}