title: Why do C and C++ support memberwise assignment of arrays within structs, but not generally?
body: <p>I understand that memberwise assignment of arrays is not supported, such that the following will not work:</p>
  
  <pre><code>int num1[3] = {1,2,3};
  int num2[3];
  num2 = num1; // "error: invalid array assignment"
  </code></pre>
  
  <p>I just accepted this as fact, figuring that the aim of the language is to provide an open-ended framework, and let the user decide how to implement something such as the copying of an array. </p>
  
  <p>However, the following does work:</p>
  
  <pre><code>struct myStruct { int num[3]; };
  struct myStruct struct1 = {{1,2,3}};
  struct myStruct struct2;
  struct2 = struct1;
  </code></pre>
  
  <p>The array <code>num[3]</code> is member-wise assigned from its instance in <code>struct1</code>, into its instance in <code>struct2</code>. </p>
  
  <p>Why is member-wise assignment of arrays supported for structs, but not in general? </p>
  
  <p><strong>edit</strong>: <strong>Roger Pate</strong>'s comment in the thread <a href="https://stackoverflow.com/questions/2009996/stdstring-in-struct-copy-assignment-issues">std::string in struct - Copy/assignment issues?</a> seems to point in the general direction of the answer, but I don't know enough to confirm it myself.</p>
  
  <p><strong>edit 2</strong>: Many excellent responses. I choose <strong>Luther Blissett</strong>'s because I was mostly wondering about the philosophical or historical rationale behind the behavior, but <strong>James McNellis</strong>'s reference to the related spec documentation was useful as well. </p>