So let's go ahead and introduce a couple other capabilities so that we can finally start writing programs that maybe print out charts or interact with the user, play games, or the like.
让我们继续来介绍其他几个功能,以便我们最终能开始写程序,那样可以打印图表或与用户交互,打游戏之类的。
So the end result, because someone wrote this function years ago is that printf takes this thing, takes this thing, David plops David inside the middle of that formatted string and then renders the whole result.
基于这是某人多年以前写的程序,最终的结果是打印出这个,这个,在格式化字符串中间的,然后返回结果。
I don't have to go read what it printed out in the screen. This has returned a value that I can use. Because I could do a test to say, is this a return value? If it's not, I'll do something else with it. So the binding is still there, it simply doesn't print it out.
我不想读到屏幕中打印出来的这行字,程序返回过一个我能够使用的值,因为我可以做个小测试,来说明这是否是返回的值,如果不是,我可以做一些其它的事,而这个绑定依然在这儿,没有打印任何东西。
But what you would have seen is the program just doing this, printing out to the screen.
但是你看到的只是程序,打印字符串到屏幕上。
I'm first printing the zero argument which I said is the name of the program itself.
我先打印参数,这是那个程序本身的名字。
I'm not wasting time typing out arguments and implementing more complicated function.
我不会在浪费时间在打印输出参数上,我执行了更复杂的程序。
Go ahead and implement with the person next to you a program that takes as input from the user an integer called F and prints out the answer of the Celsius equivalent.
继续和你旁边的人执行程序,取来自用户的整数F作为输入,然后打印出与之等价的摄氏温度的答案。
应用推荐