#include <iostream>
#include <cstring>
Class MyClass{
public:
explicit MyClass(const char* str){
std::cout << str << std::endl;
}
};
int main(int argc, char* argv[]){
std::string title = "Hello World!";
MyClass obj1(title); // This will not compile, because with explicit
// keyword we blocked implicit convertion from
// std::string to const char*
MyClass obj2(title.c_str()) // Now it works, because we paste in a
// const char* with c_str() method!
return 0;
}