Assigning a variable of a struct that contains an instance of a class to another variable
- by xport
In my understanding, assigning a variable of a struct to another variable of the same type will make a copy. But this rule seems broken as shown on the following figure. Could you explain why this happened?
using System;
namespace ReferenceInValue
{
class Inner
{
public int data;
public Inner(int data) { this.data =…