variable-sized object may not be instantiated

int temp[r] = {0} won't work.