Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 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);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement