String,PChar,PByte,Array of Char,Array of Byte 转换---来自大富翁

it2022-05-11  62

String,PChar,PByte,Array of Char,Array of Byte 转换---来自大富翁

*****************引用******************************var  s:string;  pc:pchar;  pb:pbyte;  ac:array[1..100] of char;  ab:array[1..100] of byte;  i:integer;begin  s:='this is a test';  pc:=pchar(s);             //string->pchar  pb:=pbyte(pc);            //pchar->pbyte  for i:=1 to length(s) do    begin    ac[i]:=s[i];           //string->arrary of char    ab[i]:=byte(s[i]);    //string->arrary of byte      end;  s:=pc;                 //pchar->string s:=string(pb);        //pbyte->string s:=c;                 //arrary of char->string;  end;

posted on 2010-12-02 23:09 linyawen 阅读( ...) 评论( ...) 编辑 收藏

转载于:https://www.cnblogs.com/linyawen/archive/2010/12/02/1894947.html

相关资源:数据结构—成绩单生成器

最新回复(0)