lenelex.com
Home
Quizzes
Games
Register
Log in
Question 1 of 15
What is the output of the following program?
class Program { static void Main() { int a; Initialize(out a); Console.Write(a); } static void Initialize(out int p) { p = 32; } }
A. 0
B. 32
C. Compiler Error
D. [null]
Passing a value-type variable by reference
When passing a value-type variable to a method by reference, any changes that take place in the method affect the original variable in the calling program.
Links:
The [out] Keyword