title: Is this a correct or acceptable way to pass an address to a function?
body: <p>Using 2 facts about C,</p>
  <ol>
  <li><p>In C programming, an integer pointer will point to an integer value whose address is provided to the pointer.</p>
  </li>
  <li><p>And in pass by reference, we are actually passing the original variable's address to a function.</p>
  </li>
  </ol>
  <p>so, is the following acceptable :</p>
  <pre><code>    #include&lt;stdio.h&gt;
  
      void square(int *p)
      {
          *p = (*p)*(*p);
      }
  
      int main()
      {
          int var = 10;
          square(&amp;var);       // Address of the variable
          printf(&quot;\nSquared value : %d&quot;,var);
          
          return 0;
      }
  </code></pre>
  <p>Though this is doing the same work (if not wrong) as the following :</p>
  <pre><code>    #include&lt;stdio.h&gt;
  
      void square(int *p)
      {
          *p = (*p)*(*p);
      }
  
      int main()
      {
          int var = 10;
          int *ptr;
          ptr = &amp;var;
          square(ptr);       // Pointer as the argument
          printf(&quot;\nSquared value : %d&quot;,var);
          
          return 0;
      }
  </code></pre>