如是在Cb中就蛮容易的,
在delphi中以下示例:
var
s:string;
pcchar;
pbbyte;
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:=s;
//string->arrary of char
ab:=byte(s);
//string->arrary of byte
end;
s:=pc;
//pchar->string
s:=string(pb);
//pbyte->string
s:=c;
//arrary of char->string;