lundi 4 février 2019

Is it possible to append a structure at a particular offset in its derived class in c++?

Just wanted to ask if it's possible to append a struct at a particular offset, in its derived class?

Example -

struct A
{
    int a;
    char b;
};

struct B : A
{
    int c; // place this before b?
};

Aucun commentaire:

Enregistrer un commentaire