C#: can ‘out’ parameters in functions be object properties/variables?
eg:
can I call a function as follows:
someFunction(x, y, out myObject.MyProperty1)
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Properties are [a pair of get and set] methods with a cute syntax for invoking them that makes them look like fields.
Out parameters can be references to fields or stack based ‘fields’ (i.e., locals).
The bridging of this gap is generally not addressed by languages (and definitely not directly by the CLR and IL model). (+1 on @Heinzi for the VB trickery references)