So now, henceforth, when you say, to declare a function, I am declaring a function here but down here am I quote unquote defining it or implementing it.
从此以后,当你说,声明一个函数,我在这里声明了一个函数,但是到这里我定义它或执行它。
So when you define a function, you have, as we've seen these curly braces, that define all ; of the code that's associated with that function; open curly brace code, close curly brace, that is the function.
当你定义一个函数,就像我们看到的这些花括号,定义了与,那个函数相关的所有代码;,左花括号,代码,右花括号,这就是一个函数。
c point You can see inside of it, it's got a set of definitions for things like functions.
我会把它简短的命名为,你可以看到类的里面,有一个对于函数之类的东西的定义集。
So we do, in fact, have a dependence on what the angle is of the electron as we define it in the orbital.
实际上当我们定义电子在这个轨道,它的波函数的确是和角度有关的。
We'll then look at the quantity, internal energy, which we define through the first law, and we think of it as a function of two variables T and V.
接下来我们考虑内能,这是由热力学第一定律定义的物理量,我们把它看作T和V的函数。
So in return to, we have a slight variance here, -- where I'm defining apparently -- declaring a function called cube.
作为应答,这里我们有一点变化,这里我显然定义了-,声明了一个叫做cube的函数。
But this choice of names, both for my functions and also for my parameters or my variables is completely up to me.
但是这个名字的选择,包括我的函数名,和我的参数名,或者变量名都是我定义的。
Absolutely, by functions, but you can also create local scope with curly braces.
绝对的,是由函数定义的,但是你也可以用花括号来创建局部范围。
> How can you name the function ?
>,你怎么样定义一个函数【听不见的】?
> Are scopes defined by curly braces or by functions?
>,范围是由花括号定义的还是函数定义的?
We're defining the function at the bottom.
我们在底端定义那个函数。
So how do you define a function?
你怎么样来定义一个函数?
It's defined in CS50's library; its sole purpose in life is to ask the user for a floating point value and return it.
它被定义在CS50的函数库中,它的唯一目的是,向用户询问一个浮点数的值,然后返回它。
Are -- is scope defined by curly braces or by functions?
范围是由花括号定义的还是函数定义的?
So let's just think exactly what this means, and that means that if we take away function and we define it in terms of n, l and m sub l, what we're defining here is the complete description of an orbital.
让我们来考虑一下这是什么意思,这是说如果我们不考虑波函数,而是用n,l,m下标l来定义它,我们定义的,是一个轨道的完整描述。
It's defined later down which is fine.
等下再定义这个函数,那也是可以的。
See, I've defined f of x to be a function x=x+1 that takes a value of x in, changes x to x+1, x and then just returns the value.
我定义了f是一个函数,输入x,让,然后输出。
So even though increment is obviously increment declared and defined in this function, it's later; so it's too late for me to use it in main.
很明显,即使在这个函数中,已经声明和定义;,也太迟了,以至于,我在main函数中不能使用它。
应用推荐