/*
The text book claims that operator new initializes objects when it
allocates space.  This is at least not true for built in types as seen
below.  It may be may be true for other types.
*/

#include <iostream>
#include <new>
using namespace std;

int main(int argc, char** argp, char** envp)
{

  double* tmp = new(nothrow) double[15];
  if (!tmp) cerr << "fail\n";

  for (int i=0; i<5; ++i) tmp[i]=1.0;

  delete [] tmp;

  tmp = new(nothrow) double[15];
  if (!tmp) cerr << "fail\n";

  for (int i=0; i<15; ++i) cout << tmp[i] << '\n';

  return 0;

}
