关于delphi指针,记得在C语言中可以用*取指针的值(就是指针存放的地址的值),,那么在delphi中怎么实现
typepnext=^Tperson;Tperson=recordname:string;age:Word;next:pnext;end;varperson:Tperso...
type
pnext=^Tperson;
Tperson=record
name:string;
age:Word;
next:pnext;
end;
var
person:Tperson;
str:string;
begin
str:='%s今年%d岁';
person.name:='李四';
person.age:=18;
ShowMessage(Format(str,[person.name,person.age]));
Memo1.Lines.Add(Format(str,[person.name,person.age]));
person.next:=@person;
Edit1.Text:=person.next;
end; 展开
pnext=^Tperson;
Tperson=record
name:string;
age:Word;
next:pnext;
end;
var
person:Tperson;
str:string;
begin
str:='%s今年%d岁';
person.name:='李四';
person.age:=18;
ShowMessage(Format(str,[person.name,person.age]));
Memo1.Lines.Add(Format(str,[person.name,person.age]));
person.next:=@person;
Edit1.Text:=person.next;
end; 展开
1个回答
展开全部
type
pnext=^Tperson;
Tperson=record
name:string;
age:Word;
next:pnext;
end;
var
person:Tperson;
str:string;
begin
str:='%s今年%d岁';
person.name:='李四';
person.age:=18;
ShowMessage(Format(str,[person.name,person.age]));
Memo1.Lines.Add(Format(str,[person.name,person.age]));
person.next:=@person;
Edit1.Text:=person.next^.name;
end;
pnext=^Tperson;
Tperson=record
name:string;
age:Word;
next:pnext;
end;
var
person:Tperson;
str:string;
begin
str:='%s今年%d岁';
person.name:='李四';
person.age:=18;
ShowMessage(Format(str,[person.name,person.age]));
Memo1.Lines.Add(Format(str,[person.name,person.age]));
person.next:=@person;
Edit1.Text:=person.next^.name;
end;
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询