To access each element in array we could use:Code:void *heap[size * sizeof(T)];
Is there another way to create heap allocated array without initialization?Code:T &operator [] (unsigned int index) { return *reinterpret_cast< T * >(heap + index *sizeof(T)); }
The code above will call the MyClass' default constructor 1024 times!Code:MyClass myObjects[1024];