读书笔记1 : program paradigm
summary 1:
各个类型在内存中所占的byte
char 1 short 2 int 4
关于 * &的关键
generic type 里用void *
用(char *)强制转化,用于对偏移量进行导向stack的实现
malloc 与 relloc
memcpy 与 memmove
malloc 出来的空间在mem中的位置(heap segment)
stack segment 中的指令执行顺序:从上往下
汇编语言中, .2R表示R寄存器的低两位
函数中参数的次序:
int i=4;
foo(1,2);
在栈中的次序:
int
2
1
调用函数 sp=sp-n
返回时记得sp=sp+n
sp是用来指向存储数据的指针
pc是用来指向指令的指针
preprocessor
#define max(a, b) a>b?a:b
#ifndef
..................
#endif
segment failure : null pointer
bus error: dereference old address