s1 I have a variable called s1 and it's char * of type char * so here we go.
我有一个变量,它的类型是。
Well, we would have to H+ have one of these hydrogen atoms go to an H plus, * plus an electron, right? **H --> H+ + e-** So, now we have a hydrogen ion here.
我们先要让,一个氢原子变成氢离子,加上一个电子,对么*,我们现在有一个氢离子了。
Based on the lessons we've been telling if I say *, you know what I have a computer.
基于我们讲过的课程,如果我指明,我有一台计算机。
Let's multiply both sides by 2, I'll get 2q1* is equal to a - c over b - q1*.
等式两边同时乘以2,得到,2q1*=/b-q1
And it treats it as a string, it's simply getting me back 52*7 the value of that string, 52 times 7, rather than the value of it.
这让Python把它当做字符串来对待,他返回给我了,一个字符串的值,而不是这个数的和。
* So at top left we have a slash and a star - and that says everything that follows that-- those symbols is just a comment.
在左上角,大家可以看到,这是用来告诉大家,所有跟在它后面的-,标记都只是注释而已。
a Well, on the left-hand side now we say *a so it's the same thing.
嗯,在左边,现在我指明,它是同样的东西。
a It looks like we're putting *a.
好像我们放了。
temp = *a This line of code here, temp gets *a.
这一行代码。
I'll leave the algebra there, transfer it up here, q1* = q2* = a - c over 3b.
先把算式留在那好了,我在这里再抄一遍吧,q1*=q2*=/3b
Well, it's a prefix most of the symbols in this function with just an asterisk, with a * from the keyboard so Shift-8.
好的,在这个函数中它是一个前缀符号,就是一个星号,在键盘中用Shift-8输入。
It'll give me q1* is equal to a - c over 2b - q1* over 2.
会得到,q1*=/2b-q1*/2
char * s1 Then I go ahead and declare a char * called s1.
然后我声明。
When you declare a pointer yourself manually, you do say char * the variable name because recall that's the same thing that we did earlier but we called it instead string.
当你手动声明一个指针是,你可以说char,*,变量名字,因为那是我早些时候做的事情,但是我们叫它为字符串。
This is copy2.c. At the very beginning I, again, demand say something and then I declare s1 to be a string, aka char *, and I store in s1 the string the user types in.
这是copy2。c,在开头打印一句话,然后声明s1是一个字符串,也叫做char,*,然后把用户输入的字符串存储在s1中。
I have 3 q1* is equal to a - c over b; and finally divide by 3 q1* is equal to a - c over 3b.
q1*= /b,最后两边同除以3得,q1*=/3b
And what does N log N feel like vis-a-vis N squared?
同N平方相比,N*log,N又是怎样的呢?
Well, go back to what I did before.
我会用a*a的b-1次方的形式来表达。
But that merging process only takes N steps, N*log N so that's N times log of N. Now, it's a little tricky to reason through this perhaps the first time, let's just take a very simple example and see if we can do a little sanity check here.
但这个合并过程只需要N步,所以时间复杂度是,第一次对此进行推论可能会有点儿棘手,我们举一个简单的例子,看看我们能否做一些完整性的检查。
int No. Even though the key word has changed from char to int, the * is the same and the fact that I've got a * there is saying this is a pointer to an int or a pointer to a char pointers are always the same size on a computer.
不,即使即使关键字从char变成了,指针的大小还是一样的,我用*表示这是一个int型指针,而不是char型指针,在同一台机子上,它们的大小是一样的。
Actually, we can do it a little better than that, since we know the game is symmetric, we know that S1* is actually equal to S2*.
实际上我们能得出更多,因为我们知道这个博弈是对称的,我们知道S1*=S2
Indeed, swap in your printout there is just defined as now taking *a and *b and then it also uses the * later, but we'll come back to what the different uses of the * means, but for now I claim conceptually it just means swap has access to the locations of its parameters.
的确,在打印资料中的swap被定义为,携带*a和*b,之后它也是带*号的,但是我们将说明*的不同用法,现在,我断言swap可以,使用参数的地址。
So *a. What's A?
那么*a,a是什么?
And conceptually, the idea of cubing a value feels like you could package that up into a little box, a little tool that takes input, a value, and returns output the answer A* so you don't have to constantly do A star, A*A So this program ,at the end of today, is pretty much the same thing.
概念上,算一个值的立方就像是,你可以把一个值打包放在一个小盒子里,一个用来接收输入的工具,一个值,然后返回一个答案,所以你并不需要一直使用,等等。,A,star,,A,,and,so,forth。,这个程序,最后,是一个差不多的东西。
It may mean something different and this is sort of just stupid re-use of syntax although frankly it wouldn't really be much fun to have yet a symbol so they went with the same symbol which is pretty reasonable in the context *a of a function prototype this just means *a expect A to be the address of an int and expect B to be the address of an int.
这里的意思有点不同,这是为了重使用的目的,虽然这个符号没有什么意义,所以在函数原型中,他们就使用了相同的符号,这只是表示,期望,是一个int型的地址,期望b是一个int型的地址。
应用推荐