摘要:
1、数组定义 C/C++: int a[]; C#: int[] a;2、初始化数组 C/C++: int a[] = new int[5]{1,4,2,10,7}; C# : int[] a = new int[5]{1,4,2,10,7};3、一个小程序Program.cs 1 using System; 2 using System.Collections.Generic; 3 using System.Linq; 4 using System.Text; 5 6 namespace array 7 { 8 class Program 9 {10 ... 阅读全文
摘要:
1、结构体和枚举一样,都是在代码的主体外部声明的。 1 using System; 2 using System.Collections.Generic; 3 using System.Linq; 4 using System.Text; 5 6 namespace StructEnum 7 { 8 enum orientation : byte 9 { 10 north = 1,11 south = 2,12 east = 3,13 west = 414 }15 struct route16 ... 阅读全文