C++指针两例
分析程序给出下面两段代码的输出结果,并给出具体原因(运行环境基于gcc version 7.5.0 (Ubuntu 7.5.0-3ubuntu1~18.04)):
代码一
#include <iostream>
using namespace std;
void foo(const void* ptr)
{
std::cout << "In foo(void*)" << std::endl;
}
void foo(bool b)
{
std::cout << "In foo(bool)" << std::endl;
}
......