I have an example similar below in another question that I have not seen before.
new int[m_size](); ^^
I saw and used the new int[m_size] version all the time, but not the one with () at the end.
new int[m_size]
()
Two words: Initialization of values
new int[m_size](); The elements of the array will be initialized to zero by writing () , because () implies initializing the value. 1 (zero initialization for primitive type)
new int[m_size]();
1: An object whose initializer is an empty set of brackets, i.e. (), must be initialized with a value. ($ 8.5 / 7)
this means that all elements will be zero initialized , similar to calloc(o,sizeof(int)) , where with this calloc, ur, initializing a single integer on the heap with 0
zero initialized
calloc(o,sizeof(int))
0