##%zu for sizeof

##return/exit
在main函数中调用exit和return结果是一样的,但在子函数中调用return只是代表子函数终止了,在子函数中调用exit,那么程序终止。
##NULL
#define NULL ((void *)0)
const&pointer
c
int a = 1;
int b = 2;
//指向常量的指针
//修饰*,指针指向内存区域不能修改,指针指向可以变
const int * p1 = &a; //等价于int const *p1 = &a;
//*p1 = 111; //err
p1 = &b; //ok
//指针常量
//修饰p1,指针指向不能变,指针指向的内存可以修改
int * const p2 = &a;
//p2 = &b; //err
*p2 = 222; //ok
read from right to left:
const int * p: a pointer p point to const int
p-->a pointer p
*-->point to
int * const p: a const pointer p point to int
pointer - pointer
c
#include <stdio.h>
int main()
{
int a[] = {0,1,2,3,4};
int * p2 = &a[2];
int * p4 = &a[4];
int n = p4 - p2;//2
int m = (int)p4 - (int)p2;//8
return 0;
}