OMG! than I do not know what to say.. C++ is are highly discouraged :(  Having printf("%s\n", (std::string(x)).c_str()); looks really weird considering existence of 'cout' for standard library.