What is the difference between [Out] and out in C #?

I saw how when searching for P / Invoke definitions ... sometimes it is used [Out], and sometimes out... I assume that they are the same.

+3
source share
2 answers

They are equivalent to each other when used in context P/Invoke- see OutAttribute .

You can apply OutAttribute to the values ​​and types of links passed by reference to change the In / Out behavior to Out-only behavior, which is equivalent to using the out keyword in C #.

+4
source

In addition to James's answer, note that the contextual keyword is used in two contexts:

  • As a parameter modifier in parameter lists

: http://msdn.microsoft.com/en-us/library/t3c3bfhx.aspx

+1

All Articles