ReadFloat We'll look at it in a second. Let me sort of set the stage up for this -- suppose I want to input -- I'm sorry I want you as a user to input a floating point number.
名字叫,我们来看一会,我先来设置下情景-,假设我想输入,抱歉,我希望你们作为用户来输入一个浮点数。
Let's assume that the user typed in a pretty short word we didn't run out of memory or anything crazy so here's the new feature.
假设用户输入,很短的单词,没有出现超出内存之类的问题,这里是新的特点。
And I could take that information, type it up into a program, make some assumptions about speed and direction and what routes they're going to take and actually watch the ambulance go to St. John's Mercy.
我得到这条信息之后,将它输入程序里,假设它们的速度和方向,以及它们应走哪条线路,就能看到救护车进入圣约翰医院。
I certainly don't want to assume they're always going to type a three-letter or a four-letter or a two-letter word I want some dynamism but that's fine because get string can get a string of any length, I can then use the string length function to just ask while the program is running how big is the string that I was handed?
当然我不能假设他总是,输入3个字符或4个字符,或2个字符的单词,我想要动态地分配,因为GetString可以获得任意长度的字符串,然后我可以使用strlen函数,来得到那个我传递的字符串,有多长?
应用推荐