When you modify volts[n] in the array, because you have passed a pointer to the array you're directly modifying the array volts in main itself.
void func(int *y)
y=5; // modifies x in main
printf("%d\n",x); // will print 5, not 0
Didn't test this but it should compile and run.