The first array declaration is initializing a array and then initializing all it's elements to their default values. So in your case it would initialize them to whatever values they have by CUSTOMVERTEX's default constructor.

The second array declaration is initializing a array and leaving all it's elements uninitialized. So each element is holding a random value and will be undefined behavior.

For example run this program and study it a bit and see if that can help you figure out why.

12345678910111213141516171819202122

#include <iostream>int main()
{
// Will initialize all the elements to 0 since that is the default for integersint arrayOne[8] = {};
// Will create the array with 8 elements but each element will be uninitialzed// and will hold some random value or maybe even 0 depending on the// implementation. This is undefined behavoir.int* arrayTwo = newint[8];
std::cout << "Array One \n\n";
for (int i = 0; i != 8; ++i)
std::cout << arrayOne[i] << std::endl;
std::cout << "\nArray Two \n\n";
for (int i = 0; i != 8; ++i)
std::cout << arrayTwo[i] << std::endl;
delete[] arrayTwo;
}

The other important difference is that the second declaration dynamically allocates the memory for the array on the heap, and leaves the developer responsible for writing code to free the memory once it's no longer required.

The first declaration reserves memory in a way that depends on the context - it could be global, or it could be local. The lifetime of that memory is determined by the context in which it is declared.

so I don't really understand the difference in the behaviour later on
As I understand in both cases "vertices" is basically a pointer so aside from the memory allocation differences both cases should be interchangeable thus can be used in the same way and produce the same results ?