Gon*_*era 2 c heap stack vector
以下是否正确?
"堆中的向量(带
sbrk
或malloc
)从低地址开始,然后变为高地址".
例如:
int *vec = sbrk(5*sizeof(int)):
Run Code Online (Sandbox Code Playgroud)
vec[0]
在地址中0x500
并且vec[1]
在0x504
.
但是在堆栈中,int vec[5]
从高地址到低地址.
例如:
vec[0]
在... 0xFF8
vec[1]
是0xFF4
.这样对吗?