Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- [shoorik@devproxy-test-v ~]$ cat a.cpp
- #include <stdio.h>
- struct T1 {
- char a;
- int b;
- };
- class T2 {
- public:
- char a;
- int b;
- };
- class T3 {
- public:
- char a;
- int b;
- virtual void foo() {
- }
- };
- struct __attribute__ ((__packed__)) T4 {
- char a;
- int b;
- };
- int main () {
- return printf ("%d %d %d %d\n", sizeof(T1), sizeof(T2), sizeof(T3), sizeof(T4));
- }
- [shoorik@devproxy-test-v ~]$ g++ a.cpp
- [shoorik@devproxy-test-v ~]$ ./a.out
- 8 8 16 5
- [shoorik@devproxy-test-v ~]$
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement