Check out example codes for "swapping values in java using a function not working". It will help you in understanding the concepts better.

Code Example 1

#include <stdio.h>

int main() {
   int a = 23, b = 47;
   int t;
   printf("Before. a: %d, b: %d\n", a, b);
   t = a;
   a = b;
   b = t;
   printf("After.  a: %d, b: %d\n", a, b);
   return 0;
}

Learn ReactJs, React Native from akashmittal.com