codice:#include <iostream> #include <exception> std::string * NewString (const char * theCString){ std::string * a = new std::string (theCString); return a; } int main (int argc, char * const argv[]) { std::string * aString = NewString ("Hello World"); std::cout << (*aString) << std::endl; delete aString; return 0; }

Rispondi quotando