Top "New-operator" questions

new is a language construct that dynamically allocates memory from free store and initialises the memory using the constructor.

How to add to an existing hash in Ruby

In regards to adding an key => value pair to an existing populated hash in Ruby, I'm in the process …

ruby new-operator hash
Using "Object.create" instead of "new"

Javascript 1.9.3 / ECMAScript 5 introduces Object.create, which Douglas Crockford amongst others has been advocating for a long time. How do I …

javascript constructor new-operator object-create
What uses are there for "placement new"?

Has anyone here ever used C++'s "placement new"? If so, what for? It looks to me like it would …

c++ memory-management new-operator placement-new
Deleting an object in C++

Here is a sample code that I have: void test() { Object1 *obj = new Object1(); . . . delete obj; } I run it in …

c++ object memory-management new-operator
Open button in new window?

How would I go about making the button open in a new window, emulating "a href, target = _blank"? I currently …

javascript html button window new-operator
Why should C++ programmers minimize use of 'new'?

I stumbled upon Stack Overflow question Memory leak with std::string when using std::list<std::string>, and …

c++ memory-management heap new-operator c++-faq
How to initialise memory with new operator in C++?

I'm just beginning to get into C++ and I want to pick up some good habits. If I have just …

c++ initialization memory-management new-operator
How does delete[] know it's an array?

Alright, I think we all agree that what happens with the following code is undefined, depending on what is passed, …

c++ arrays pointers new-operator delete-operator
When should I use the new keyword in C++?

I've been using C++ for a short while, and I've been wondering about the new keyword. Simply, should I be …

c++ pointers reference new-operator keyword
When to use "new" and when not to, in C++?

Possible Duplicate: When should I use the new keyword in C++? When should I use the "new" operator in C++? …

c++ new-operator