Top "New-operator" questions

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

Do the parentheses after the type name make a difference with new?

If 'Test' is an ordinary class, is there any difference between: Test* test = new Test; and Test* test = new Test();

c++ constructor initialization new-operator c++-faq
What is parsing in terms that a new programmer would understand?

I am a college student getting my Computer Science degree. A lot of my fellow students really haven't done a …

parsing new-operator
Is delete this allowed?

Is it allowed to delete this; if the delete-statement is the last statement that will be executed on that instance …

c++ memory-management new-operator delete-operator self-destruction
Create a folder inside documents folder in iOS apps

I just want to create new folders in the documents folder of my iPhone app. Does anybody know how to …

iphone directory new-operator document nsfilemanager
The difference between virtual, override, new and sealed override

I'm pretty confused between some concepts of OOP: virtual, override, new and sealed override. Can anyone explain the differences? I …

c# oop overriding virtual new-operator
delete[] an array of objects

I have allocated and array of Objects Objects *array = new Objects[N]; How should I delete this array? Just delete[] …

c++ arrays new-operator delete-operator
Conversion from 'myItem*' to non-scalar type 'myItem' requested

I have this C++ code: #include <iostream> using namespace std; struct MyItem { int value; MyItem* nextItem; }; int main() { …

c++ new-operator
Setup std::vector in class constructor

I'm designing a class that has a std::vector<int> as an instance variable. I'm using a std::…

c++ constructor new-operator stdvector
Difference between new and override

Wondering what the difference is between the following: Case 1: Base Class public void DoIt(); Case 1: Inherited class public new void …

c# inheritance overriding new-operator
How do you 'realloc' in C++?

How can I realloc in C++? It seems to be missing from the language - there is new and delete …

c++ new-operator realloc delete-operator