Calling new for a string. - C++ Operator

C++ examples for Operator:new

Description

Calling new for a string.

Demo Code

#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;
}

Result


Related Tutorials