Expect the address of an int but here in the context of the function itself inside the curly braces, it means go to that address.
一个整型数的地址,但是在函数,大括号中的环境中,意思是定位到那个地址。
Now, if I've asked the user for a string and then a moment later I ask the user for another string, well, they're going to end up in different locations in memory just by nature of get string.
现在,如果我要用户输入一个字符串,一会儿之后我要用户输入另一个字符串,他们最终是在,不同的内存地址中。
Well, get string again is returning the address of the string the user typed in, D the address of the very first character like the letter D and storing that address in this variable s1.
好的,GetString返回的是,用户输入的字符串的地址,第一个字符的地址,比如字母,然后把这个地址存储在这个变量s1中。
Well, maybe this ended up at location 7, 8, 7 8 9 9 so what's really in x is the number 7, 8, 9, which is the address in memory, but again, uninteresting.
嗯,可能这个在地址7,8,9结束,那么在x中实际上是数字,那是内存中的地址,但是,那是没有什么用的。
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中存储的是用户输入的字符串的首地址,这样第一个字节存储在这块,新的堆的地方,这个是唯一的修正。
So that is actually making a copy of the address and putting it in s2.
这实际上是复制一个地址,然后放置在s2中。
So at this point in the story, the addresses are still in A 1 2 3 and B; 4, 5, 6 and 1, 2, 3.
在这里,地址还是子啊a和b中,4,5,6,和。
Instead I'm going to be expecting the address of some int and the address of another int and thanks to this address I can literally find this address in RAM, do anything I want there, -- return and what I've just done is actually changed or mutate the values of those original variables.
我们所期望的是int型地址,和另外一个int型地址,幸亏这个地址,我可以找在RAM中找到它的地址,然后做我想做的事情,返回我处理后的东西,我可能改变了这些源变量。
应用推荐