How do you determine the size of an object in C++?

前端 未结 11 968
轮回少年
轮回少年 2020-11-28 05:38

For example, say I have a class Temp:

class Temp
{
    public:
        int function1(int foo) { return 1; }
        void function2(int bar) { foobar = bar; }         


        
11条回答
  •  抹茶落季
    2020-11-28 06:31

    If you want detailed information about how objects are represented in memory at run-time, the ABI (Application Binary Interface) specification is the place to look. You'll need to look determine which ABI your compiler implements; for example, GCC versions 3.2 and above implement the Itanium C++ ABI.

提交回复
热议问题