Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
Reference Type parameter by Ref vs. Normal
//Microsoft (R) Visual C# Compiler version 3.4.0-beta4-19562-05 (ff930dec) //Copyright (C) Microsoft Corporation. All rights reserved. using System; using System.Collections.Generic; using System.Linq; using System.Text.RegularExpressions; namespace Rextester { public class Program { public static void Main(string[] args) { MyType myInstance = new MyType() { MyInt = 5, MyDate = DateTime.MinValue, MyString = "One" }; //Your code goes here Console.WriteLine($"MyInt: {myInstance.MyInt}, MyDate: {myInstance.MyDate}, MyString: {myInstance.MyString}"); PassTypeHere(myInstance); Console.WriteLine($"MyInt: {myInstance.MyInt}, MyDate: {myInstance.MyDate}, MyString: {myInstance.MyString}"); PassTypeHereByRef(ref myInstance); Console.WriteLine($"MyInt: {myInstance.MyInt}, MyDate: {myInstance.MyDate}, MyString: {myInstance.MyString}"); } public static void PassTypeHere(MyType value) { value = new MyType() { MyInt = 10, MyDate = DateTime.MaxValue, MyString = "Two" }; Console.WriteLine($"MyInt: {value.MyInt}, MyDate: {value.MyDate}, MyString: {value.MyString}"); } public static void PassTypeHereByRef(ref MyType value) { value = new MyType() { MyInt = 10, MyDate = DateTime.MaxValue, MyString = "Two" }; Console.WriteLine($"MyInt: {value.MyInt}, MyDate: {value.MyDate}, MyString: {value.MyString}"); } public class MyType { public int MyInt { get; set; } public DateTime MyDate { get; set; } public string MyString { get; set; } } } }
run
|
edit
|
history
|
help
0
সদফঘজ্যুয়হতগ্রফেদ
Problem: on_off
base interior 0.1
Daimone
MVC Learning
30272 Program Ex5_1 if else_2
The given number is prime or even
DaysOfYear
asxsdxasd sd
Sorting Square Problem