Created
July 26, 2014 00:03
-
-
Save Fhernd/7188e6448fab2a855bc2 to your computer and use it in GitHub Desktop.
Estructura punto en C#.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
namespace Articulos.Preguntas | |
{ | |
public struct Punto | |
{ | |
public int x; | |
public int y; | |
public Punto (int x, int y) | |
{ | |
this.x = x; | |
this.y = y; | |
} | |
} | |
public sealed class PuntoPrueba | |
{ | |
public static void Main() | |
{ | |
Punto a = new Punto (13, 13); | |
Punto b = a; | |
a. x = 19; | |
// Impresión de la ordenada 'x' de la variable `b`: | |
Console.WriteLine ( b.x); // Salida: 13 | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment