Sunday, March 29, 2015

I was trying to use an "out int" parameter in one of my functions. How should I declare the variable that I am passing to it?

Question:I was trying to use an "out int" parameter in one of my functions. How should I declare the variable that I am passing to it??

Answer: </P><P align=justify>You should declare the variable as an int, but when you pass it in you must specify it as &#39;out&#39;, like the following: </P><P align=justify>int i;</P><P align=justify>foo(out i);</P><P align=justify>where foo is declared as follows: </P><P align=justify>[return-type] foo(out int o) { }

Tags:Interview Questions, Microsoft, C#,

Please submit your Interview Answer for the above Question via replying to this post. Thank you for visiting to our blog, Have a Good Day!.



Sponsor Advertisement



Human Resource Management Software

Human Resource Management Software

Powerful, configurable software for human resources management that is easy to manage and remarkably cost-effective, whatever the size of your company. Now there’s a smarter, more efficient way to handle all of your people-related activities. Easy-to-use system manages the full hire-to-retire lifecycle...

No comments:

Post a Comment