Pergunta

I've seen both when looking up P/Invoke definitions... sometimes [Out] is used, and sometimes out... I'm assuming they're the same.

Foi útil?

Solução

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

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#.

Outras dicas

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

  • As a parameter modifier in parameter lists

  • In generic type parameter declarations in interfaces and delegates

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

Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top