Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
No Overload takes 5 arguments
Message
De
23/09/2013 06:23:57
 
 
À
22/09/2013 05:30:32
Information générale
Forum:
ASP.NET
Catégorie:
Code, syntaxe and commandes
Versions des environnements
Environment:
C# 4.0
OS:
Windows Server 2012
Network:
Windows 2008 Server
Database:
MS SQL Server
Application:
Web
Divers
Thread ID:
01583574
Message ID:
01583860
Vues:
25
>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;
>		}
>		
>	}
>
True. OK - back to message 1583810:
" value types : depending on the size of the value type "

What if the parameter is a biggish structure. More bytes to pass there. e.g.
 public struct LotsOfDoubles
    {
        public double a, b, c, d, e, f, g, h, i, j;
    }
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform