1 2 3 4 5 6 7 8 9 10 11 12
#include <string> #include <iostream> using namespace std; void a(const char* s) { cout << "boop! " << s; } void a(string s) { a(s.c_str()); } int main() { a(string("hello world")); }
1
boop! hello world