const 与指针 :值不变还是指针不变?
typedef ——定义类型!!!
详例:
http://c.biancheng.net/view/298.html
eg: XV6 kernel/types.h 中:
typedef unsigned int uint;
typedef unsigned short ushort;
typedef unsigned char uchar;
typedef unsigned char uint8;
typedef unsigned short uint16;
typedef unsigned int uint32;
typedef unsigned long uint64;
typedef uint64 pde_t;
既定义了struct,以定义了新类型Processtree
typedef struct processtree{
pid_t pid;
char name[40];
struct childprocesses *children;
}Processtree;
打印地址(指针地址)时,最好用%p
%p是打印地址(指针地址)的,是十六进制的形式,但是会全部打完,即有多少位打印多少位。
32位编译器的指针变量为4个字节(32位),64位编译器的指针变量为8个字节(64位)。