标签:nts classes com alt send 技术 size button nap
unit Unit4; interface uses Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants, System.Classes, Vcl.Graphics, Vcl.Controls, Vcl.Forms, Vcl.Dialogs, Vcl.StdCtrls; type TForm4 = class(TForm) Button1: TButton; Memo1: TMemo; Button2: TButton; procedure Button1Click(Sender: TObject); private { Private declarations } public { Public declarations } end; var Form4: TForm4; implementation {$R *.dfm} procedure integer1(a: Integer); begin a := a + 1; end; procedure integer2(const a: Integer); begin //什么都不做 a.ToString; end; procedure integer3(var a: Integer); begin a := a + 1; end; procedure integer4(out a: Integer); begin a := a + 1; end; procedure Int641(a: Int64); begin a := a + 1; end; procedure Int642(const a: Int64); begin //什么都不做 a.ToString; end; procedure Int643(var a: Int64); begin a := a + 1; end; procedure Int644(out a: Int64); begin a := a + 1; end; procedure TForm4.Button1Click(Sender: TObject); var i: Integer; i2: Int64; begin i := 10; i2 := 10; Integer1(i); Memo1.Lines.Add(i.ToString); end; end.
首先Integer1---无修饰符
=========================================================================
integer2---const
=========================================================================
integer3---var
=========================================================================
integer4---out
经过测试 int64也是如此。
结论:整型 是传值的,就是说 所有的整型要么值复制一份入栈,要么直接用原来的值,与堆无关。
标签:nts classes com alt send 技术 size button nap
原文地址:http://www.cnblogs.com/del88/p/6389306.html