Right? I've allocated a variable, it happens to be a pointer; it's still a variable, who know what's in it, right?
对不?我分配了一个变量,它碰巧是一个指针,它还是一个变量,谁知道它里面是什么?
s1 I have a variable called s1 and it's char * of type char * so here we go.
我有一个变量,它的类型是。
And the answer is, you can use a variable anywhere you can use the value.
答案是,在需要用到值的,任何地方都可以使用变量。
So, and of course, you know, keeping entropy as a fixed variable for a system like that is extremely cumbersome.
所以,对这样的系统要求它们的熵保持恒定,和一个非常笨拙做法。
You can put a variable there, and because it's not encapsulated in curly braces, as we just discussed, that essentially means it's accessible everywhere in that file.
你可以加入一个变量,因为它不是封装在花括号里,就像我们刚才讨论的,本质的意思是它可以在文件的所有地方,都可以被访问到。
C So here I'm declaring a variable called c, and I'm pretty much translating the formula from the slide using the characters on my keyboard to a floating point value.
这里我声明了一个变量,然后我把那个幻灯片上的公式,用键盘上的字符翻译成了,浮点数值。
Anything where you're actually keeping track of something like a score that's having a variable that you increment -- plus, plus, or decrement, minus, minus, using the appropriate puzzle piece could certainly be compelling.
你需要保存像分数这样的事物时,你就需要一个变量,它可以自加,++,或者自减,要使用正确的拼图。
And that test is usually a value of a variable.
测试通常是针对变量的值。
x Inside of that structure, create a variable name x, and a value associated with it.
创建了一个变量名为,然后给它赋值,请注意我也在这边做的操作。
If I want to try and decide how to tackle a problem in an iterative matter, here the steps I'm going to go through. First thing I'm going to do, is I'm going to choose a variable that's going to count.
但是这就是我对它的观点,如果我试着去以迭代的方式,解决一个问题的话,下面是我应该采取的步骤,第一件要做的事情。
Right.? I'm going to set up a variable to say, none what's the answer I want to return, is it there or not. Initially it's got that funny value none.
看我要找的答案在不在数组里面,初始化为,然后建立一个索引。
Let me write a function, in fact the literal thing I would do is to say, identify the things that change, give each of them a variable name because I want to refer to them, and then write a function that captures the rest of that computation just with those variable names inside.
让我来写个方法,实际上我的意思是,辨别出变化的东西,然后给它们逐个命名以区分,然后写一个用来计算,这些变量的,包括计算过程的方法。
And it's up to me to put that return value in a variable.
那个放在变量中的值是取决于我所赋的值。
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.
忘记初始化,忘记初始化变量是一个很常见的错误,运行完一个循环之后,当需要再次初始化时。
And when I create a binding, x I'm taking a variable name, in this case x, stored somewhere in a table, and I'm creating a link or a pointer from that name to that value.
当我创建一个绑定的时候,我有一个变量的名字,在这个例子中是,存在一个表中的某处,然后创建一个连接,或者指针从这个名字指向目标值。
I set up a variable here, called input OK.
我会在这里建立个变量。
You got to store it in a variable.
你把它存储在一个变量里。
It's going to be stored away in a variable.
结果值会被储存在变量里。
I declare a variable called n. I'm not giving it a value yet, so I had better be careful.
我申明一个变量n,我先不给它赋值,所以我最好小心点。
And I've got to worry about, is somebody else using ANS, answer, as a variable, in which case I've got to be really careful. Is somebody else using x as a variable? I've got to deal with a lot of those details.
而且我还要担心有没有别人,使用了ANS,answer作为变量,这样我就必须要非常小心,有没有别人用x当做变量呢?,我需要处理很多类似的细节。
Well, this block here on the left that I came counter counter=0 up with arbitrarily sets a variable called counter equal to 0 and then it forever says that counters value 1 and then it changes the counter by 1.
大家看一下左边的这一段代码,其中有一个随便定义的变量,它会一直显示counter的值,每显示一次,counter加。
When you created a variable in scratch, you could either make it for this sprite only or for all sprites. All right.
当你在scratch中创建一个变量,你可以只为这个精灵创建,或者为全部的精灵而创建,好的。
Now at this point in the story, I've got a variable called n. I've stored it in int.
现在这个故事的这里,我获得了一个变量n,我把它存储成int型的。
Now, unlike high school math or in algebra Z where you call things X and Y and Z, in programming, in computer science, you're actually dealing with humans where it's useful to have a variable name that's more descriptive than X and Y and Z.
不像高中数学或者代数中,称为X和Y和,在程序设计和计算机科学里,你实际上是在和人打交道,在这里有个描述性比xyz更强的,变量名称是很重要的。
And I'm storing the answer in a variable called "answer" that's of type float.
我把这个答案存储在一个float类型的,叫做“answer“的变量中。
N So, I'm initializing a variable called N to the string length of s1.
我初始化一个变量,等于s1的字符串长度。
So declare as we'll say a variable, a placeholder called counter.
首先要定义一个名为counter的,变量。
Then I'm declaring a variable called n, it's of type int.
然后我声明了一个变量n,它是int型的。
So the system will not be described by a single state variable during the path.
因此系统将不能被,路径上的单一状态变量描述。
应用推荐