title: Structure deep copy
body: <p>This may be a very basic question but somehow it got me tricked... when I write test code, it seems to work, but something is going wrong in production.</p>
  
  <pre><code>// Header file
  #define length 100
  typedef struct testStr_t {
      int a;
      char b;
      char t1[length];
      char t2[length];
  } test;
  
  void populateTest(test*);
  
  // source file
  test test1;
  test test2;
  populateTest(&amp;test1);
  test2 = test1;
  </code></pre>
  
  <p>Will <code>test2</code> be a deep copy of <code>test1</code>? Or are there gotchas here? Does it matter if the code is compiled with a C compiler or a C++ compiler?</p>