Value initialization using an empty pair of parentheses
I've read in a book that "we can value-initialize the elements by following the array size by an empty pair of parentheses:"
Code:
int *pia = new int[10] ()
Also the same book states that the following statements will generate different results:
Code:
int *pi = new int; // pi points to an uninitialized int
int *pi = new int(); // pi points to an int value-initialized to 0
I've tested those with MinGW and I found no difference in using the pair of parentheses or not. In the case of the array, the elements will not be initialized and in the second case, pi will point to a 0 initialized int in both cases.