Quote:
Originally Posted by xpi0t0s View Post
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.

For example:
Code:
void func(int *y)
{
  y[0]=5; // modifies x in main
}
main()
{
  int x[2];
  x[0]=0;
  func(x);
  printf("%d\n",x[0]); // will print 5, not 0
}
Didn't test this but it should compile and run.
Ok thanks for all your help.