C++面向过程,char*,const char*,string类型参数与函数调用的关系
char*,const char*,string类型参数与函数调用的关系
#include<iostream>
#include<string>
using namespace std;
void func(string& s) {
cout << "1" << endl;
}
void func(char* s) {
cout << "2" << endl;
}
void func(const char* s


