是什么在C#[OUT]之间进出的区别? [英] What's the difference between [Out] and out in C#?
本文介绍了是什么在C#[OUT]之间进出的区别?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我见过这两个仰视p如果在/ Invoke的定义...有时 [OUT]
时,有时退出
...我假设它们是相同的。
I've seen both when looking up P/Invoke definitions... sometimes [Out]
is used, and sometimes out
... I'm assuming they're the same.
推荐答案
他们是等同于对方时在的P / Invoke
的上下文中使用 - 见的 OutAttribute 。
They are the equivalent to each other when used in the context of P/Invoke
- see OutAttribute.
您可以应用OutAttribute珍视和按引用传递引用类型输入/输出行为更改到Out-仅行为,这相当于在C#中使用了关键字。
You can apply the OutAttribute to value and reference types passed by reference to change In/Out behavior to Out-only behavior, which is equivalent to using the out keyword in C#.
这篇关于是什么在C#[OUT]之间进出的区别?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文