using System;
namespace Articulos.Preguntas
{
public struct UsoThisEnEstructura
{
private int campo;
public UsoThisEnEstructura(int valor)
{
this.campo = valor;
}
public void Metodo(int a)
{
this.campo = a;
Console.WriteLine(campo.ToString());
this = new UsoThisEnEstructura(9);
Console.WriteLine(campo.ToString());
}
public static void Main()
{
UsoThisEnEstructura ut = new UsoThisEnEstructura(3);
ut.Metodo(4);
}
}
}
dXNpbmcgU3lzdGVtOwoKbmFtZXNwYWNlIEFydGljdWxvcy5QcmVndW50YXMKewogICAgcHVibGljIHN0cnVjdCBVc29UaGlzRW5Fc3RydWN0dXJhCiAgICB7CiAgICAgICAgcHJpdmF0ZSBpbnQgY2FtcG87CiAgICAgICAgCiAgICAgICAgcHVibGljIFVzb1RoaXNFbkVzdHJ1Y3R1cmEoaW50IHZhbG9yKQogICAgICAgIHsKICAgICAgICAgICAgdGhpcy5jYW1wbyA9IHZhbG9yOwogICAgICAgIH0KICAgICAgICAKICAgICAgICBwdWJsaWMgdm9pZCBNZXRvZG8oaW50IGEpCiAgICAgICAgewogICAgICAgICAgICB0aGlzLmNhbXBvID0gYTsKICAgICAgICAgICAgCiAgICAgICAgICAgIENvbnNvbGUuV3JpdGVMaW5lKGNhbXBvLlRvU3RyaW5nKCkpOwogICAgICAgICAgICAKICAgICAgICAgICAgdGhpcyA9IG5ldyBVc29UaGlzRW5Fc3RydWN0dXJhKDkpOwogICAgICAgICAgICAKICAgICAgICAgICAgQ29uc29sZS5Xcml0ZUxpbmUoY2FtcG8uVG9TdHJpbmcoKSk7CiAgICAgICAgfQogICAgICAgIAogICAgICAgIHB1YmxpYyBzdGF0aWMgdm9pZCBNYWluKCkKICAgICAgICB7CiAgICAgICAgICAgIFVzb1RoaXNFbkVzdHJ1Y3R1cmEgdXQgPSBuZXcgVXNvVGhpc0VuRXN0cnVjdHVyYSgzKTsKICAgICAgICAgICAgCiAgICAgICAgICAgIHV0Lk1ldG9kbyg0KTsKICAgICAgICB9CiAgICB9Cn0=