Top "New-operator" questions

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

Why would one replace default new and delete operators?

Why should would one replace the default operator new and delete with a custom new and delete operators? This is …

c++ operator-overloading new-operator c++-faq delete-operator
How to chain method on a newly created object?

I would like to know whether there's a way to chain methods on a newly created object in PHP? Something …

php constructor new-operator method-chaining
What is the point of "static new" modifier for a function?

Today, I found something in legacy code. It has "static new" for one function. It looks like this. class Foo { …

c# static new-operator modifier
C++: new call that behaves like calloc?

Is there a call I can make to new to have it zero out memory like calloc?

c++ new-operator calloc
Operator new for Arduino

I've been told (specifically in an answer to C++ Standard Library on Arduino, and in Stack Overflow question C++ string …

c++ arduino new-operator arduino-ide
What does 'new' keyword mean when used inside an interface in C#?

Developing an interface generic I wished to declare a constructor in an interface but it says constructors are forbidden there. …

c# .net interface new-operator
Why new keyword not needed for String

I am new in java. In java, String is a class.But we do not have to use new keyword …

java string object new-operator
Is it possible to use a C++ smart pointers together with C's malloc?

Some of my code still uses malloc instead of new. The reason is because I am afraid to use new …

c++ malloc new-operator smart-pointers
Finding size of dynamically allocated array

Why is it not possible to get the length of a buffer allocated in this fashion. AType * pArr = new AType[…

c++ size new-operator dynamic-allocation
IE won't load PDF in a window created with window.open

Here's the problem, which only occurs in Internet Explorer (IE). I have a page that has links to several different …

javascript internet-explorer window new-operator window.open