title: Diff Between Call By Reference And Call By Pointer
body: <p>Can any one tell me the exact diff between call by pointer and call by reference. Actually what is happening on both case?</p>
  
  <p><strong>Eg:</strong> </p>
  
  <p><strong>Call By Reference:</strong></p>
  
  <pre><code>void swap(int &amp;x, int &amp;y)
  {
     int temp;
     temp = x; /* save the value at address x */
     x = y;    /* put y into x */
     y = temp; /* put x into y */
  
     return;
  }
  
  swap(a, b);
  </code></pre>
  
  <p><strong>Call By Pointer:</strong></p>
  
  <pre><code>void swap(int *x, int *y)
  {
     int temp;
     temp = *x; /* save the value at address x */
     *x = *y; /* put y into x */
     *y = temp; /* put x into y */
  
     return;
  }
  
    swap(&amp;a, &amp;b);
  </code></pre>