Objects of a class share same code segment for methods?
<p>Hi
For example we have code</p>

<pre><code>class MyClass
{
   private:
   int data;
   public:
   int getData()
   {
      return data;
   }
};

int main()
{
   MyClass A, B, C;
   return 0;
}
</code></pre>

<p>Since A, B and C are objects of <code>MyClass</code>, all have their own memory.
My question is that, are all of these objects share same memory for methods of class ( <code>getData()</code> in this case) or all objects have separate code segment for each object.?</p>

<p>Tnahks in advance....</p>
