codepad
[
create a new paste
]
login
|
about
Language:
C
C++
D
Haskell
Lua
OCaml
PHP
Perl
Plain Text
Python
Ruby
Scheme
Tcl
struct Empty { }; struct JustLong { long data; }; struct LongAndEmpty : public JustLong, private Empty { }; struct StringAndEmpty: public std::string, private Empty { }; int main() { cout << "Empty:" << sizeof(Empty) << endl; cout << "JustLong:" << sizeof(JustLong) << endl; cout << "String:" << sizeof(std::string) << endl; cout << "LongAndEmpty:" << sizeof(LongAndEmpty) << endl; cout << "StringAndEmpty:" << sizeof(StringAndEmpty) << endl; return 0; }
Private
[
?
]
Run code
Submit