title: memset for initialization in C++
body: <p>memset is sometimes used to initialize data in a constructor like the example below. Does it work in general ? Is it a good idea in general?</p>
  
  <pre><code>class A {
  public:
     A();
  private:
     int a;
     float f;
     char str[35];
     long *lp;
  };
  
  A::A()
  {
     memset(this, 0, sizeof(*this));
  }
  </code></pre>