Problem with void function

The way you've written it, a CANNOT change. the function is passed a COPY of a, which you are changing. That copy is discarded as soon as you exit the function. If you want to change the original a, change your function to:

void pR(int &a,int b,int c){[color=#222222][/color]
  if(a == b){[color=#222222][/color]
    a=c;[color=#222222][/color]
  }[color=#222222][/color]
}

This passes a reference to a, so the function CAN change a.

Regards,
Ray L.