我是C++的新手,不懂这个结构.
InterceptionKeyStroke &kstroke = * (InterceptionKeyStroke *) &stroke
Run Code Online (Sandbox Code Playgroud)
我知道&=指针.但是,这是什么意思?
* (InterceptionKeyStroke *)
Run Code Online (Sandbox Code Playgroud)
打破它:
InterceptionKeyStroke // a type...
& // ...which is by reference
kstroke // named 'kstroke'
= // bound to (since references are bound)
* // something that a pointer points to
(InterceptionKeyStroke*) // "I know what the type is!" cast
& // address of...
stroke // ...variable named 'stroke'
Run Code Online (Sandbox Code Playgroud)
因此,*(InterceptionKeyStroke*)转换为指针,然后取消引用指针.
| 归档时间: |
|
| 查看次数: |
138 次 |
| 最近记录: |