title: Reference to pointers Swap in c++
body: <p>Can someone tell me if my understanding is right ? can someone tell me if the code below is for reference to pointers ?</p>
  
  <pre><code># include &lt;iostream&gt;
  using namespace std;
  
  //function swaps references, 
  //takes reference to int as input args and swap them
  void swap(int&amp; a, int&amp; b)
  {
      int c=a;
      a=b;
      b=c;
  }
  
  int main(void)
  {
      int i=5,j=7;
  
      cout&lt;&lt;"Before swap"&lt;&lt;endl;
      cout&lt;&lt;"I:"&lt;&lt;i&lt;&lt;"J:"&lt;&lt;j&lt;&lt;endl;
      swap(i,j);
      cout&lt;&lt;"After swap"&lt;&lt;endl;
      cout&lt;&lt;"I:"&lt;&lt;i&lt;&lt;"J:"&lt;&lt;j&lt;&lt;endl;
      return 0;
  
  }
  </code></pre>