If I do this and this but then I also put some other quotes inside, what's the computer potentially gonna think?
如果我双引号里面再套双引号,那电脑会怎么想呢?
There's one more piece that we'd like to get out of that, and that is-- you may have been wondering, what's with the funky stuttering here of three double-quotes in a row. All right? And that is a specification.
但是你没有屏蔽这个函数的使用细节,在这里我们还想再讲一讲,那就是--你可能正在想,这里连续3个奇怪双引号,是干什么用的。
So if I want to use a string as we'll call it which is a word or phrase generally, they always go between double quotes, David hence the quotes around David, and they are double quotes not single quotes intentionally.
当我们要表示单词啊,词组啊,句子啊等等这样的东西时,就会用到字符串,它们位于双引号之间,也就是这里双引号之间的,是双引号,不是单引号哦。
But the string, the sentence or the words that we're displaying on the screen, previously you clicked on a little white text field and typed it in, well now you're gonna do the same thing at the keyboard but you're gonna have to sandwich it in between double quotation marks.
这些你想输出到屏幕上的字符串啊,语句啊,单词啊,或者你事先,在白色输入框中敲进去的内容,现在你们需要用键盘做同样的事情,但是你们要写在,双引号之间。
So the double quote says here comes the input.
双引号代表在这里填上想要输入的东西。
Sometimes you need to escape a double quote.
有时候是双引号。
printf So thus far, the things I put David between quotes are just simple things like David or David backslash N, but what if I want to do call my self David in quotes, right?
像我们前面提到的,我们把要显示的东西放在双引号之间,譬如,或,David反斜杠n,但是如果我自己的名字本来就叫,“David“
Someone-- or someone had to implement, had to write a tool called printf that itself takes input between quotes and produces as output some characters on the screen.
需要有人去实现,这个printf函数,以双引号间的信息为输入,输出相应字母到屏幕上。
Well, before I just hardcoded a string inside of printf's double quotes.
在printf的双引号之间写死一个,字符串之前。
Now I'm putting count in double quotes, not to make it a string, but to say, this is count generically. It could be counting one by one through the integers, it could also be taking a collection of data and going through them one by one. It could be doing counting in some other mechanism.
现在我把count用双引号标起来,不是说把它命名为一个字符串,而是说,这是一个通用的计数器,它可能是每一次减1的整数,也可能是拿一个集合的数据然后,一个一个的访问它们,也可能是以某种机制来计数。
应用推荐