Added information about out parameters in C#.

This commit is contained in:
chris@chriszimmerman.net 2015-10-15 20:37:29 -04:00
parent 66bc42e31b
commit 4e0db77a0c

View File

@ -7,6 +7,7 @@ contributors:
- ["Shaun McCarthy", "http://www.shaunmccarthy.com"] - ["Shaun McCarthy", "http://www.shaunmccarthy.com"]
- ["Wouter Van Schandevijl", "http://github.com/laoujin"] - ["Wouter Van Schandevijl", "http://github.com/laoujin"]
- ["Jo Pearce", "http://github.com/jdpearce"] - ["Jo Pearce", "http://github.com/jdpearce"]
- ["Chris Zimmerman", "https://github.com/chriszimmerman"]
filename: LearnCSharp.cs filename: LearnCSharp.cs
--- ---
@ -394,6 +395,7 @@ on a new line! ""Wow!"", the masses cried";
ref int maxCount, // Pass by reference ref int maxCount, // Pass by reference
out int count) out int count)
{ {
//the argument passed in as 'count' will hold the value of 15 outside of this function
count = 15; // out param must be assigned before control leaves the method count = 15; // out param must be assigned before control leaves the method
} }