fork(1) download
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. struct structure __attribute__ ((__packed__)) {
  5. char a;
  6. int b;
  7. char c;
  8. };
  9.  
  10. int main() {
  11.  
  12. std::cout << sizeof(struct structure) << '\n';
  13.  
  14. return 0;
  15. }
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
prog.cpp:4:47: error: expected unqualified-id before ‘{’ token
 struct structure __attribute__ ((__packed__)) {
                                               ^
prog.cpp: In function ‘int main()’:
prog.cpp:12:38: error: invalid application of ‘sizeof’ to incomplete type ‘structure’
  std::cout << sizeof(struct structure) << '\n';
                                      ^
stdout
Standard output is empty