Loading...
「ツール」は右上に移動しました。
利用したサーバー: natural-voltaic-titanium
274いいね 3366回再生

C# val vs ref vs out parameters

val vs ref vs out
------------------------------------------------------------------------------------------------------------------
The ref and out  keywords in C# is used for the passing the arguments to methods as a reference type.
It means any changes made to this argument in the method will be reflected in that variable when control returns to the calling method
These keywords are generally used when a method returns multiple values.

Note: By default parameters are passed as val type
Both ref and out are treated differently at run time and they are treated the same at compile time.

subscribe to this channel using below link:
   • C# var VS dynamic, readonly VS const  

コメント