Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- /// <summary>
- /// Contoh penggunaan struct
- /// </summary>
- class StructExample
- {
- static void Main()
- {
- // kita buat instance dari Rectangle struct
- Rectangle rect1 = new Rectangle();
- rect1.Width = 1;
- rect1.Height = 3;
- // sekarang kita tampilkan hasilnya di console
- Console.WriteLine("rect1: {0}:{1}", rect1.Width, rect1.Height);
- Console.ReadKey();
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment