这个C函数怎么写成Delphi呀,请高手帮忙(100分)

  • 主题发起人 主题发起人 xingtu
  • 开始时间 开始时间
X

xingtu

Unregistered / Unconfirmed
GUEST, unregistred user!
void aaa(unsigned char * passwd, int length)
{
int i;
unsigned char temp;
for( i = 0
i < length
i++)
{
temp = 0;
passwd = ~passwd;
temp = passwd;
passwd = passwd/16;
temp = temp & 0x0f;
temp = temp*16

passwd = temp + passwd;
}
}
 
procedure aaa(passwd:array of Byte;len: Integer);
var
i: Integer;
temp: Byte;
begin
for i:=0 to len-1 do
begin
passwd:= not(passwd);
temp:= passwd;
passwd:= passwd div 16;
temp:= temp or $0F;
temp:= temp*16;
passwd:= temp+ passwd
end;
end;

因为很久没碰PASCAL了,所以不一定对, 也没调试过……
 
procedure aaa(passwd string, length integer)
var i: integer;
temp: integer;
begin

for i:=0 to length -1 do
begin
temp = 0;
passwd = ~passwd;
temp = passwd;
passwd = passwd/16;
temp = temp or $0x0f;
temp = temp*16

passwd = inttostr(temp + strtoint(passwd));
end
end

dcms
2006-11-05
 
procedure aaa(passwd string, length integer)
var i: integer;
temp: integer;
begin

for i:=0 to length -1 do
begin
temp = 0;
passwd = ~passwd;
temp = passwd;
passwd = passwd/16;
temp = temp or $0x0f;
temp = temp*16

passwd = inttostr(temp + strtoint(passwd));
end
end

dcms
2006-11-05
 
半年没搞 delphi不知道是否对啊!
 
接受答案了.
 
后退
顶部