Data hosted with ♥ by Pastebin.com - Download Raw - See Original
  1. using System;
  2.  
  3. namespace Articulos.Preguntas
  4. {
  5.     public struct UsoThisEnEstructura
  6.     {
  7.         private int campo;
  8.        
  9.         public UsoThisEnEstructura(int valor)
  10.         {
  11.             this.campo = valor;
  12.         }
  13.        
  14.         public void Metodo(int a)
  15.         {
  16.             this.campo = a;
  17.            
  18.             Console.WriteLine(campo.ToString());
  19.            
  20.             this = new UsoThisEnEstructura(9);
  21.            
  22.             Console.WriteLine(campo.ToString());
  23.         }
  24.        
  25.         public static void Main()
  26.         {
  27.             UsoThisEnEstructura ut = new UsoThisEnEstructura(3);
  28.            
  29.             ut.Metodo(4);
  30.         }
  31.     }
  32. }