We can value-initialize the elements by following the array size by an empty pair of parentheses:int *pia2 = new int[10] (); // array of 10 uninitialized ints The parentheses are effectively a request to the compiler to value-initialize the array, which in this case sets its elements to 0. |
|
|
btw: I use Dev-c++, I'm wondering if this is the cause. |