Alignment in C++

Discussion in 'C++' started by puzzlecracker, Jan 14, 2005.

  1. I wasn't as to how pertinent this section is for the following
    question, but I did receive this question in some relation to C++. In
    addition, I couldn't find a better fitting section for the question
    (please direct me to the proper section although I would HIGHLY
    APPRECIATE IF SOMEONE CAN ANSWER OR GIVE POINTERS TO where I CAN GET
    THE ANSWER AND UNDERLINING EXPLANATION, for this is prime, favorite and
    trustworthy group).

    Here it goes:

    What are the alignment rules for 16, 32, 64 bit machine - would
    certainly appreciate a down-to-earth, comprehensive reference? For
    example, what is the layout for these examples?
    a)

    Code:
    struct
    {
    short int a;
    int b;
    };



    b)
    Code:
    struct{
    short int a;
    int b;
    int somefunc();
    virtual int func1();
    };

    c) Very Tricky (Hint: it is tricky with virtual function (or should I
    say pointers to vtable...you should know something about vtables in
    last but clever case))

    Code:
    struct{
    short int a;
    int b;
    virtual int func_1();
    virtual int func_2();
    :
    :
    virtual int func_n();
    };



    And lastly, is there a group for algorithms particularly a riddle type,
    (problems - such as to find a largest subarray in array of positive and
    negative integers, or contests type)... also where a somewhat decent
    analysis of algorithms takes place... thanks a million!!!!
     
    puzzlecracker, Jan 14, 2005
    #1
    1. Advertising

  2. * puzzlecracker:
    > [homework]


    We don't do homework; check the FAQ.

    --
    A: Because it messes up the order in which people normally read text.
    Q: Why is it such a bad thing?
    A: Top-posting.
    Q: What is the most annoying thing on usenet and in e-mail?
     
    Alf P. Steinbach, Jan 14, 2005
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. =?Utf-8?B?bWFudQ==?=

    Regd---Justify option in Alignment.

    =?Utf-8?B?bWFudQ==?=, Sep 23, 2005, in forum: ASP .Net
    Replies:
    0
    Views:
    446
    =?Utf-8?B?bWFudQ==?=
    Sep 23, 2005
  2. ALuPin

    Phase alignment

    ALuPin, May 17, 2004, in forum: VHDL
    Replies:
    0
    Views:
    586
    ALuPin
    May 17, 2004
  3. Sunil Menon

    Re: Help required for alignment problem

    Sunil Menon, Jun 26, 2003, in forum: ASP .Net
    Replies:
    0
    Views:
    813
    Sunil Menon
    Jun 26, 2003
  4. Anne
    Replies:
    0
    Views:
    651
  5. Anne
    Replies:
    0
    Views:
    525
Loading...

Share This Page