Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
No Overload takes 5 arguments
Message
From
22/09/2013 05:30:32
 
 
To
21/09/2013 13:42:00
General information
Forum:
ASP.NET
Category:
Coding, syntax and commands
Environment versions
Environment:
C# 4.0
OS:
Windows Server 2012
Network:
Windows 2008 Server
Database:
MS SQL Server
Application:
Web
Miscellaneous
Thread ID:
01583574
Message ID:
01583830
Views:
40
On an afterthought

>>And if you use 'ref' you are forced to instantiate the objects before the call otherwise it won't compile ; 'out' avoids that....

Nowhere is it written that you have to instantiate the objects before the call - only that they have to be initialized

A null value is ok
	static class Test_RefOut
	{
		internal static void Go()
		{
			Dictionary<string, string> dict = null;

			int x = GetDictByRef(ref dict);

			Console.WriteLine("result : {0}", dict);
		}

		static int  GetDictByRef(ref Dictionary<string, string> dict)
		{
			//dict = new Dictionary<string, string>();
			return 2;
		}
		
	}
Gregory
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform