可能重复: C++:空类对象的大小是多少?
为什么以下输出1?
1
#include <iostream> class Test { }; int main() { std::cout << sizeof(Test); return 0; }
c++ sizeof
c++ ×1
sizeof ×1