You can actually initialize multiple things at once by separating them with a comma, and this is sometimes helpful.
你可以一次性初始化很多东西,通过用逗号分开它们,这有时是有用的。
I'm gonna keep as part of each stock, it's history of prices, which we can initialize, well, I've initialized it as empty, but that's probably the wrong thing, right?
我会把股票的历史价格,作为每只股票的一部分,我们可以先对它的历史价格进行赋值,好了,我先给它赋了空值,但是这样做可能不对,是吗?
It's how you can initialize a variable to like zero for counting's sake or something like that.
你可以初始化一个变量,像0用来,计数的或者诸如此类的。
And I'm going to initialize it, create them, with an opening price.
我要对它进行初始化,给它们一个初始价格然后创建它们。
Second thing I do, I need to initialize it.
我要做的第二件事。
And I need to initialize it outside of the loop.
我需要初始化它。
Initialization. A very common bug is to initialize a variable. Go through a loop, and then forget to reinitialize it when it needs to be reinitialized again.
忘记初始化,忘记初始化变量是一个很常见的错误,运行完一个循环之后,当需要再次初始化时。
I initialize it to false.
我把它初始化为假值。
We've seen in class that you get garbage values if you don't initialize something to a value so let me actually initialize x to a value.
我们在课程上了解到,如果你不给一个变量,进行赋值,它会获得一个无效值,让我把x初始化为一个值。
i So I have up here at the top of my program a variable called i 0 of type int, and I have to initialize it up here to zero.
所以在程序的顶端我有一个int类型的变量,我需要把它初始化为。
应用推荐