dimanche 7 mars 2021

in c++ what would happen if we are instantiating an object in global section and the object size is too big?

Consider the following example:

Foo foo;

int main()
{
    //...
}

What would happen if the size of Foo is too big and allocation fails? Consider a small device with limited memory. Also, what difference would it make if Foo is instantiated within main function?

Aucun commentaire:

Enregistrer un commentaire