请问:@的用途是什么?(详细者高分)

aq13 2002-09-12 05:39:09
取地址?详细点说明
...全文
53 6 打赏 收藏 转发到动态 举报
写回复
用AI写文章
6 条回复
切换为时间正序
请发表友善的回复…
发表回复
9igogo 2002-09-12
  • 打赏
  • 举报
回复
The @ operator returns the address of a variable, or of a function, procedure, or method; that is, @ constructs a pointer to its operand. For more information about pointers, see Pointers and pointer types. The following rules apply to @.

If X is a variable, @X returns the address of X. (Special rules apply when X is a procedural variable; see Procedural types in statements and expressions.) The type of @X is Pointer if the default {$T杴 compiler directive is in effect. In the {$T+} state, @X is of type ^T, where T is the type of X.
If F is a routine (a function or procedure), @F returns F抯 entry point. The type of @F is always Pointer.

When @ is applied to a method defined in a class, the method identifier must be qualified with the class name. For example,

@TMyClass.DoSomething

points to the DoSomething method of TMyClass. For more information about classes and methods, see Classes and objects.
drizzt123 2002-09-12
  • 打赏
  • 举报
回复
简单说就是取地址,要详细嘛,打开delphi6\help\Del6op.hlp查@就行,

The @ operator

The @ operator returns the address of a variable, or of a function, procedure, or method; that is, @ constructs a pointer to its operand. For more information about pointers, see Pointers and pointer types. The following rules apply to @.

If X is a variable, @X returns the address of X. (Special rules apply when X is a procedural variable; see Procedural types in statements and expressions.) The type of @X is Pointer if the default {$T杴 compiler directive is in effect. In the {$T+} state, @X is of type ^T, where T is the type of X.
If F is a routine (a function or procedure), @F returns F抯 entry point. The type of @F is always Pointer.

When @ is applied to a method defined in a class, the method identifier must be qualified with the class name. For example,

@TMyClass.DoSomething

points to the DoSomething method of TMyClass. For more information about classes and methods, see Classes and objects.
u2m 2002-09-12
  • 打赏
  • 举报
回复
取地址,还怎么和你详细说?
这方面 delphi 资料介绍的不多,它和c语言的&功能一样,你去查c
里面关于这个&符号的资料吧
aq13 2002-09-12
  • 打赏
  • 举报
回复
能否给点实例分析一下啊?
Crystal_Boy 2002-09-12
  • 打赏
  • 举报
回复
取地地址
可以取变量或函数.过程的地址
耙子 2002-09-12
  • 打赏
  • 举报
回复
取地址操作符!

你会c吗?如果会点那么就相当于c里面的& 取地址操作。
如果没学过C,那么你的确很难理解这东西。

5,388

社区成员

发帖
与我相关
我的任务
社区描述
Delphi 开发及应用
社区管理员
  • VCL组件开发及应用社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧