My example :
double* test () {
const double TAX = .08;
double* total = calTax(); // calTax return pointers
for (int x = 0; x < SIZE; x++)
total[x] *= TAX;
return total;
}
Do we need to use delete on this example?
will this cause problem?
Probably, since calTax() probably uses new to allocate it's pointer and probably doesn't use some random global variable.