CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2
  1. #1
    Join Date
    Jun 1999
    Posts
    10

    MEMORY ALLOCATION

    please answer me this question:

    how is the memory allocated for this:

    class A
    {
    int a;
    int b;
    float c;
    void finc();
    virtual func1();
    }

    A *ptr = new A



  2. #2

    Re: MEMORY ALLOCATION

    if you wondering that
    sizeof(A) is bigger than sizeof(a)+sizeof(b)+sizeof(c)
    it is because virtual-table added to structure
    but if is at start or end and how are real sizes of items and whole strucure it depends on compiler, os, no/debug
    maybe this helps you
    t!


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured