I can use that to return values, which I can then use elsewhere, which I did-- and if I just come back and highlight this-- inside of that computation.
我可以用它来返回值,然后我可以在别的地方使用这些返回值,正是我做的--如果我回过头来,在高亮一下这个--在这部分计算内部。
So, thankfully I know I have storage space for return values.
很庆幸我们为返回值预留了存储空间。
You call for us to return to our values, the values that define this country as a nation.
您呼吁我们重拾价值观,那些将我们凝聚成一个民族的价值观。
Second thing we saw is, that using this as a computation, I can return multiple values.
我们看到的第二件事是把它用作计算,我可以返回多个值。
So functions and return values.
函数和返回值。
So this first little piece of code right here says, ok you give me 2 points, I'll create another 1 of these lists and I'll simply take the x, sorry I shouldn't say x, I'm going to assume it's the x, the x-values are the two points, add them together, just right there, the y-values, add them together and return that list.
好,为了来认识到这一点,让我们来看一个简单的小例子,在你们的课堂手册上,你可以看到我写了一个小程序,它假设我得到了,这些点中的一些,我想对它们做一些操作,例如我想把它们加到一起,那么这里的第一小片,代码的意思是,好给我两个点,我会再创建一个数组。
It has 3 possible values it could return.
它有三个可能返回的值。
x and get the values of x and y attached to this thing and return them to me.
和y值然后把它们返回给我,It’s,going,to,go,off,这就是我想要的东西,我想要我的类里面有一些方法。
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中找到它的地址,然后做我想做的事情,返回我处理后的东西,我可能改变了这些源变量。
应用推荐