unsigned char GetMy(unsigned char* source,unsigned char leng) reentrant
{
for(;leng!=0;leng--) 
{
  dscrc=aa[dscrc^(*source)];
  source++;
}
return(dscrc);
}问题为:在DELPHI里用什么类型代替C语言下的char*

解决方案 »

  1.   

    麻烦那位帮上面的代码转成DELPHI代码,小弟一天搞这东东头都晕了
      

  2.   

    function GetMy(source:PByte;leng:Byte):Byte;
    //{
    Begin
    //for(;leng!=0;leng--)
    while leng<>0 do
    //{
    begin   //dscrc=aa[dscrc^(*source)];
      dscrc:=aa[dscrc xor (source^)];//若数组aa的定义下标非从0开始,则须+1
      //source++;
      inc(source);
              dec(leng);
    //}
    end;
    //return(dscrc);
    Result:=dscrc;
    //}
    End;
      

  3.   

    function GetMy(source:PChar;leng:Byte):Byte;
    Begin
     while leng<>0 do
      begin
        dscrc:=aa[dscrc xor (source^)];
        inc(source);
        dec(leng);
      end;
     Result:=dscrc;
    End;