Now, as an aside, there's another couple of layers at the very top above the stack and above the heap, but below the tech segment and those are called initialized data and uninitialized data.
题外话,在堆和栈的顶端,还有好几层,但是在技术段之下,他们被叫做初始化数据和未初始化数据。
I mean it's keeping up on your desk. You can't even see your work.
这些糖果在你桌子上慢慢堆了起来,你都快看不见你的工作文件了。
I have no idea where that is other than to know that it's up so let's just go ahead and assume that everything over here is the heap so what has just happened?
我不知道它在哪里,只知道它在上面,我们假设这里所有的东西是堆,那么会发生什么呢?
You'll also see that they have all the physical constants that you're going to need, and also a bunch of the actual equations that we've been using in the first couple weeks here.
大家还可以看到这里有,你可能会用到的所有物理常数,还有一堆公式,是那些我们这几周来一直在用的。
A traditional recipe actually is based on a small set of primitives, and a good chef with, or good cook, I should say, with that set of primitives, can create an unbounded number of great dishes.
一个传统的菜谱实际上是,建立在一小堆的原材料,和一个好厨师,或者好厨子之上的,我要说,根据那堆原材料,可以创造出无数的美味佳肴来。
You can think about Crane's images of the Brooklyn Bridge in this course that abandoned woodpile that some worker has left in the poem called "The Woodpile."
你可以想一想,在我们课程中,克兰诗中的布鲁克林大桥,那被抛弃的木柴堆,在诗歌“柴垛“中一些工人放弃的柴垛“
As Lewis Carroll's Alice might have phrased it, "You're nothing but a pack of neurons."
正如刘易斯·卡罗尔,在《爱丽斯》中所描述的,"你不过是一堆神经元罢了"
Conceptually, it's put at the top of my chunk of RAM, -- below it, goes initialized and uninitialized data -- - this is a fancy way of saying global variables come next -- and below that, comes what's called the heap.
概念上,它放置在内存块的顶端,在下面,已初始化的和未初始化的数据-,这是一种指明紧随其后的全局变量的设想方式-,在后来,引入了一个叫做堆的东西。
This is the heap somewhere else in memory, but they are, in fact, in distinct locations.
这是内存中的堆,但实际上,它们在不同的地方。
This is now on the heap it's four bytes so what gets stored in X?
在堆上,它是4个字节,那么在x中存储的是什么?
It's pointing at a different place in the heap.
它在堆中指向不同的地方。
I store in s1 the address of the first byte that the user typed in and by the way that first bite happens to live in this new place called the heap and that's the only update to the story thus far.
我在s1中存储的是用户输入的字符串的首地址,这样第一个字节存储在这块,新的堆的地方,这个是唯一的修正。
You just forget where the memory is that you asked for on the heap and it's not going to get cleaned up on the stack because malloc puts it somewhere else.
你忘了你在堆中申请的内存在哪里,它将会被栈清除,因为malloc把它放在别的地方。
应用推荐