C++动态绑定中方法调用的问题

#include
using namespace std;
class Vehicle {
public:
virtual void run(int number = 10) {
cout << "we do not know how to run\n";
}
virtual void stop() {
cout << "we do not know how to stop\n";
}
void announce() {
cout << "this is a vehicle\n";
}
};
class Car :public Vehicle
{
public:
void run(int number = 60) {
cout << "driving at " << number << " km/h\n";
}
void stop() {
cout << "brake to stop \n";
}
void announce() {
cout << "this is a car\n";
}
};
void main()
{
Vehicle v1, *v2;
Car c1;
v1.run();
c1.announce();

v2 = &c1;
v2->run();
v2->stop();
v2->announce();

}
对于上面这段代码,输出的结果是
we do not know how to run
this is a car
driving at 10 km/h
brake to stop
this is a vehicle
其他都很好理解,但是第三句就不能理解了,这个时候调用了car的run()方法,但是为什么number是10?

因为你没有把run定义为virtual虚函数。所以它的调用就没有实现动态绑定,而是用的基类的函数

C++中 虚函数中的默认参数问题
http://blog.csdn.net/nwpulei/article/details/6430814