Hello,
I have a dynamically memory allocated variable pointer which has to be initialized to zero.
CODE
double *var = new double[6];
var[0] = 0;
var[1] = 0;
var[2] = 0;
var[3] = 0;
var[4] = 0;
var[5] = 0;
Is there a simpler one-line way of writing this? something like this...??
CODE
double *var = new double[6]= {0};
Because it gets tedious when I need more than 6 memory allocation?
Thanks,
prads