// File: const1.cpp // // ANSI C++ standard says const and & are // not supposed to resolve overloading, but sometimes // they do. #include using namespace std ; double AddOne(double x) { cout << "First one" << endl ; return x + 1 ; } double AddOne(double& x) { cout << "Second one" << endl ; return x + 1 ; } int main() { int n = 6 ; double y ; y = AddOne(n) ; cout << y << endl ; }