Memset an object
<pre><code>#include &lt;iostream&gt;
#include &lt;string.h&gt;
using namespace std;

class A
   {
     private:
  int a;
  int b;
  public:
  A():a(10),b(20){};
  A(int ad,int bd):a(ad),b(bd){};
  void printvalues()
  {
        cout&lt;&lt;a &lt;&lt; " " &lt;&lt;b&lt;&lt;endl;
  }
};

int main()
{

  A a(5,12);

  memset(&amp;a,sizeof(A),0);
  a.printvalues();

  return 0;
}
</code></pre>

<p>memsetting the object to 0, do not seem to have any effect on the object. Can anyone help me understand this behavior.
output:
5 12</p>
