title: Are class members guaranteed to be contiguous in memory?
body: <p>I have a class which holds a number of function pointers and I would like for them all to be initialized to NULL when objects are constructed. To do this I was planning on using memset on the memory locations from the first pointer to that of the last pointer however, I am unsure if this would work 100% of the time.</p>
  
  <p>Is it guaranteed that if these function pointers are declared contiguously within the class that their memory locations would also be contiguous. I assume that padding won't affect what I'm trying to do as any padding bytes would just be set to NULL also.</p>
  
  <p>Example class implementation</p>
  
  <pre><code>class C
  {
  private:
      void (*func1)();
      void (*func2)();
      void (*func3)();
      void (*func4)();
  };
  </code></pre>