|
조진수 님이 쓰신 글 :
: Int형을 Hex로 변형 시키는건 알겠는데, Long형을 Hex로 바꾸려면 어떻게 해야 하나요??
:
: 예) Int형 Hex : IntToHex
: Long형 Hex : ??
=====================================================================================
요렇게 해보세요
long l1;
String str1;
char ch[20];
l1=StrToInt(Edit1->Text);
str1.sprintf("%lu",l1);
Memo1->Lines->Add(str1);
memset(&ch[0],0x00,20);
memcpy(&ch[0],&l1,4);
str1.sprintf("%02x %02x %02x %02x",LOBYTE(ch[3]),LOBYTE(ch[2]),LOBYTE(ch[1]),LOBYTE(ch[0]));
Memo1->Lines->Add(str1);
===========================================================================================
|