对于基本数据类型,函数的参数前面加不加const都是一样的,但对于指针和引用,参数前面加const与不加const是不同类型的参数,因此是重载函数。 int comp(int a) { return a; } int comp(const int a) { return a; }