Skip to content

Instantly share code, notes, and snippets.

@Fhernd
Created July 26, 2014 00:03
Show Gist options
  • Save Fhernd/7188e6448fab2a855bc2 to your computer and use it in GitHub Desktop.
Save Fhernd/7188e6448fab2a855bc2 to your computer and use it in GitHub Desktop.
Estructura punto en C#.
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