title: Is it a good practice to pass struct object as parameter to a function in c++?
body: <p>I tried an example live below:</p>
  
  <pre><code>typedef struct point
  {
      int x;
      int y;
  } point;
  
  void cp(point p)
  {
      cout&lt;&lt;p.x&lt;&lt;endl;
      cout&lt;&lt;p.y&lt;&lt;endl;
  }
  
  int main()
  {
      point p1;
      p1.x=1;
      p1.y=2;
      cp(p1);
  }
  </code></pre>
  
  <p>The result thats printed out is:</p>
  
  <pre><code>1
  2
  </code></pre>
  
  <p>which is what I expected. My question is: Does parameter p get the full copy of object p1?  If so, I wonder if this is a good practice? (I assumed when the struct gets big in size, this will create a lot of copy overhead).</p>