C++ examples for Operator:new
Calling new for a string.
#include <iostream> #include <string> using namespace std; int main()/*from w ww . j av a2 s .co m*/ { string *Password = new string; *Password = "this is a test."; cout << *Password << endl; return 0; }