interviews.dotnetthread.com

↑ Grab this Headline Animator

Wednesday, May 14, 2008

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?

You should declare the variable as an int, but when you pass it in you must specify it as ‘out’, like the following: int i; foo(out i); where foo is declared as follows: [return-type] foo(out int o) { }

Submit this story to DotNetKicks

No comments:

Post a Comment

Post your comments/questions/feedback for this Article.

 

Latest Articles