OKIEWARDOYO

C#.NET No.8-4

Dec 5th, 2012
975
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.44 KB | None | 0 0
  1. using System;
  2.  
  3. /// <summary>
  4. /// Contoh penggunaan struct
  5. /// </summary>
  6. class StructExample
  7. {
  8.     static void Main()
  9.     {
  10.         // kita buat instance dari Rectangle struct
  11.     Rectangle rect1 = new Rectangle();
  12.         rect1.Width = 1;
  13.         rect1.Height = 3;
  14.  
  15.         // sekarang kita tampilkan hasilnya di console
  16.         Console.WriteLine("rect1: {0}:{1}", rect1.Width, rect1.Height);
  17.  
  18.         Console.ReadKey();
  19.     }
  20. }
Advertisement
Add Comment
Please, Sign In to add comment