摘要:
#include<stdio.h> #include<stdlib.h> #define FIRST 1 #define SECONED 2 #define THIRD 3 int main (void) { printf("%d, %d , %d\n",FIRST , SECONED, THIRD 阅读全文
摘要:
typedef是用来给类型去别名的 用法: typedef 原类型 新类型 #include<stdio.h> #include<stdlib.h> //typedef变量取别名 int main (void) { int a = 10; typedef int u32; //typedef 原类型 阅读全文
摘要:
共用体: 多个变量(不同的数据类型)共用同一块内存空间, 但是同一时刻, 只能有一个变量起作用 共用体中起作用的的成员是最后一次存放的成员 #include<stdio.h>#include<stdlib.h> //define union union myUnion{ char a; short 阅读全文
摘要:
#include<stdio.h> #include<stdlib.h> struct stu { int id; int age; char name[128]; }; /* struct heima_stu { int id; int age; char names[128]; int chin 阅读全文
摘要:
#include<stdio.h> #include<stdlib.h> struct stu { int id; int age; char name[128]; }; int main (void) { //结构体数组: 数组中的每一个元素都是结构体 struct stu num[5] = {{ 阅读全文
摘要:
只有当定义了结构体变量的时候才会分配内存空间, 比喻说 struc stu { int id; int age; char name[28]; } struct stu d; 这个时候才会分配内存空间 (1) 定义结构体类型, 以及初始化结构体变量 #include<stdio.h> //关键字 s 阅读全文
摘要:
数组名:【数组名是地址常量】-- 不可以被修改 #include<stdio.h> int main (void) { int a[3] = {1,2,3};//a是数组名, 数组名是地址常量,不能被修改 int b[3] ; printf("the a is %x", a); b = a ;// 阅读全文