2 3 Down here we said this is like 4, 5, 6 and 1, 2, 3 so this is going to be memory location 7, 7, 7, 7, 1 whatever.
在这下面,这是,4,5,6,和,这将是内存地址,7,7,7,7,1,不管是什么。
Well, it turns out on most computers an address of the location and memory, aka a pointer, is itself 32 bits.
好的,它是一个计算机内存地址,或者说一个指针,占32位。
A low-level language, we used to call this assembly programming, you're down at the level of, your primitives are literally moving pieces of data from one location of memory to another, through a very simple operation.
一个低级的语言,我们曾经将其称为假设编程,你们只是处于用基本要素,把一些数据碎片,从记忆存储器的一个地方,通过简单的操作来转到另外一个地方。
It turns out when we call string a string, we're really referring not to those characters but to the address, the location and memory of those characters.
当我说字符串时,我并不是指这些字符集,而是指地址,就是这些字符集在存储器中的位置。
That program counter points to some location in memory typically to the first instruction in the sequence.
程序计数器指示存储器当中的某些位置,尤其是指示序列中的第一个指令。
We have a pointer to the location in memory that contains the actual value, which itself might be a bunch of pointers, and we have a pointer to the actual-- sorry, a pointer the value and we have a pointer to the next element in the list. All right?
包含实际值的地址,可能实际值,也是一系列指针,这里还有指向实际,抱歉,指向下一个元素的指针,我们来整理下?
At this point in the story both s1 and s2 are literally pointing at the same location in memory so that's now what the story looks like.
在这里,s1和s2指向的是,内存中同一个地方,这里看起来像什么?
To get any location in memory, to get to any value of the list, I simply have to say which element do I want to get, I know that these things are stored in a particular size multiply that index by 4, add it to start, and then it's in a constant amount of time I can go to that location and get out the cell.
取得列表中的任何一个值,简单说来,想要取得列表中的任何元素,我知道这些元素存在特定的大小中,把下标乘以4,加到start上,然后定位到内存单元,并取出值就是固定的时间了,好的,如果元素以固定大小存储。
应用推荐