예제) struct

 

 

 

 

using System;

struct People{

  public string name;  //ß(1)

  public int age;

}

class StructTest{

  public static void Main() {

  People he;  //ß(2)

  he.name = “kym";  //ß(3)

  he.age = 20;

  Console.WriteLine("이름: {0}",he.name);//ß(4)

  Console.WriteLine("나이: {0}",he.age);

  }

}

 

 

 

 

+ Recent posts