B
bjyplbx
Unregistered / Unconfirmed
GUEST, unregistred user!
function getstr: string;
begin
result := 'Macroview';
end;
function getpachar1(a: PChar): PChar;
var
s1 : string;
begin
s1 := StrPas(a);
result := PChar(s1);
end;
function getpachar2(a: PChar): PChar;
var
s1, s2 : string;
i : integer;
begin
s1 := StrPas(a);
s2 := '';
for i := 1 to length(s1) do
begin
s2 := s2 + s1;
end;
result := PChar(s2);
end;
procedure TForm1.Button3Click(Sender: TObject);
var
s1 : string;
i : integer;
a, b, c : PChar;
begin
s1 := getstr;
a := PChar(s1);
b := getpachar1(a);
c := getpachar2(a);
showmessage(StrPas(a));
showmessage(StrPas(b));
showmessage('/' + StrPas(c) + '/');
end;
procedure TForm1.Button4Click(Sender: TObject);
var
s1 : string;
a, b : PChar;
begin
s1 := getstr;
a := PChar(s1);
b := getpachar2(a);
showmessage(StrPas(a));
showmessage(StrPas(b));
end;
显示结果非常不理想,完全都不一样啊,是地址的问题吗?
begin
result := 'Macroview';
end;
function getpachar1(a: PChar): PChar;
var
s1 : string;
begin
s1 := StrPas(a);
result := PChar(s1);
end;
function getpachar2(a: PChar): PChar;
var
s1, s2 : string;
i : integer;
begin
s1 := StrPas(a);
s2 := '';
for i := 1 to length(s1) do
begin
s2 := s2 + s1;
end;
result := PChar(s2);
end;
procedure TForm1.Button3Click(Sender: TObject);
var
s1 : string;
i : integer;
a, b, c : PChar;
begin
s1 := getstr;
a := PChar(s1);
b := getpachar1(a);
c := getpachar2(a);
showmessage(StrPas(a));
showmessage(StrPas(b));
showmessage('/' + StrPas(c) + '/');
end;
procedure TForm1.Button4Click(Sender: TObject);
var
s1 : string;
a, b : PChar;
begin
s1 := getstr;
a := PChar(s1);
b := getpachar2(a);
showmessage(StrPas(a));
showmessage(StrPas(b));
end;
显示结果非常不理想,完全都不一样啊,是地址的问题吗?