It didn't really crash, it found an assert statement. So if you look at the bottom of the function, you'll see that, in fact, I checked for that.
其实程序并没崩溃,它只是碰到一个断言语句然后停了下来,如果你看看函数的顶部,你会看到,实际上我断定计数器。
Notice in this program I have not checked whether or not the user actually provided input.
就拿这个程序说事吧,我们根本没有检查,用户到底有没有输入。
So I gave you some numbers I made up actually a long time ago, but since I've been using this game in class, somebody went out and checked.
我列举的数字都是我很久前编出来的,在我需要在课上引用数字的时候就有了,有人还为此做了调查
That's just the those-- let me use my pointer that's just these two lines here. I checked the value, and in one case, I'm changing the last to be mid minus 1, which is the case I'm in here and I just call again. All right?
来看看ppt,这里有两条线,我检查了值,在一种情况下,我把last指向了中点减一,就是这种情况,我们再来调用一下怎么样?
应用推荐