title: memset on array of structures in C++
body: <p>I have another memset question. It appears as if the code I am editing may have some issues (or it's not done the same way in different files)</p>
  
  <pre><code>A::LRM las[9]; //A and LRM are both structures with BOOLS and INTS
  memset(&amp;las, 0, sizeof(las));
  
  typedef Sec SecArray[16];
  SecArray rad_array;
  memset(rad_array, 0, sizeof(SecArray));
  </code></pre>
  
  <p>The second example appears to be correct because <code>rad_array</code> is the same as the first position in the array. Then the <code>sizeof(SecArray))</code> would make sense. The first one doesn't seem correct to me. All structs are just BOOLs and INTS nothing dynamic in them.</p>
  
  <p>My understanding from my other post about memset was that it followed this format.</p>
  
  <p><code>memset("pointer to object", "what to set it to", "size of object")</code></p>
  
  <p>Can anyone tell me what exactly is going on here if I am incorrect with my theory.</p>