procedure TForm1.Button1Click(Sender: TObject);
var
Obj: TButton;
begin
Obj := TButton.Create(Self);
ListBox1.Items.Add(IntToStr(Integer(Obj))); (1)
ListBox1.Items.Add(IntToStr(Integer(@Obj))); (2)
ListBox1.Items.Add(IntToStr(PInteger(Pointer(Obj))^)); (3)
ListBox1.Items.Add(IntToStr(Integer(Pointer(Obj)^))); (4)
Obj.Free;
end;这四句分别获得Obj对象的什么内容?
var
Obj: TButton;
begin
Obj := TButton.Create(Self);
ListBox1.Items.Add(IntToStr(Integer(Obj))); (1)
ListBox1.Items.Add(IntToStr(Integer(@Obj))); (2)
ListBox1.Items.Add(IntToStr(PInteger(Pointer(Obj))^)); (3)
ListBox1.Items.Add(IntToStr(Integer(Pointer(Obj)^))); (4)
Obj.Free;
end;这四句分别获得Obj对象的什么内容?
2 指向Obj指针地址
3 Obj虚表地址
4 同3
(2)取得是obj变量的地址
(3)取得是Tbutton类VMT表的地址
(4)同(3)
鉴别CSDN星星的含金量http://expert.csdn.net/Expert/topic/2147/2147062.xml?temp=.9299433
你让我怎么具体啊?
一个是对象在内存中的内存块的首地址
一个是指向(或者说标记)这个首地址的指针
一个是obj的类的虚表的地址
够具体了阿,如果你不明白什么是虚表和栈 堆,看看faq和以前的文章吧,帖子长了我回不了。