unsigned int change-1(char *s)
{
int ilen=0;
int iret=0;
int i;
if(s)
{
  ilen = strlen(s)+1;  
   for (i=0;i<ilen-1;i++)
    iret |= CHAR_CONVERT_TABLE[s[i]];
}
return iret;    
}

解决方案 »

  1.   


    多年没有学过 C 了, 当初学得也不好, 试一下, 错了莫笑:function Change_1(S: PChar): Cardinal;
    var
      iLen, iRet, I: integer;
    begin
      iLen := 0;
      iRet := 0;
      if S<>nil then
        for I := 0 to StrLen(S)-1 do
          iRet := iRet or CHAR_CONVERT_TABLE[Byte(S[I])];
      Result := iRet;
    end;
          
      

  2.   


    {再简化一下.}
    {----前提是我的翻译是对的----对自己没信心}function Change_1(S: PChar): Cardinal; 
    var 
      I: integer; 
    begin 
      Result := 0; 
      if S <>nil then 
        for I := 0 to StrLen(S)-1 do 
          Result := Result or CHAR_CONVERT_TABLE[Byte(S[I])]; 
    end; 
      

  3.   

     if S <>nil then 
    这句应该改为:
     if (S <>nil) and (S <> '') then 其它的看不出有什么