1. 关键字 1> 关键字就是C语言提供的有特殊含义的符号,也叫做“保留字” 2> C语言一共提供了32个关键字,这些关键字都被C语言赋予了特殊含义 auto double int struct break else long switch case enum register typedef char extern return union const float short unsigned continue for signed void default goto s…
结构体和类有点类似 我们定义一个类的时候 是class 类名 定义结构体的时候是 struct 结构体名 结构体的写法 struct Point { // public int x=10; 这种写法错误 public int x ; public int y; public int X { get { return x; } set { x = value; } } public void SayHi() { Console.WriteLine("哈哈哈哈哈")…
结构体:就是一个自定义的集合,里面可以放各种类型的元素,用法大体跟集合一样. 一.定义的例子: struct student { public int nianling; public int fenshu; public string name; public string sex; public int sum; } 以上的语句就是定义一个名称为student的结构体,其中包含int类型的年龄.分数.总和,和string类型的姓名.性别. 二.用法: 在main主函数外面定义了一个名称为st…