title: C++: Passing a struct containing an array as arg, do I need to pass as pointer?
body: <p>If I have a struct like so:</p>
  
  <pre><code>struct S
  {
      int arr[10];
      int x;
  }
  </code></pre>
  
  <p>If I have a function</p>
  
  <pre><code>void some_fun( struct S myS );
  </code></pre>
  
  <p>Will the array be copied correctly when I pass a struct S to that function or do I have to change the function to:</p>
  
  <pre><code>void some_fun( struct S * myS ); ?
  </code></pre>
  
  <p>I have tested this (and it works without a pointer) but I am a bit unsecure about C/C++, sometimes it works even though it is wrong.</p>