#include <iostream> using namespace std; struct structure __attribute__ ((__packed__)) { char a; int b; char c; }; int main() { std::cout << sizeof(struct structure) << '\n'; return 0; }
Standard input is empty
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'; ^
Standard output is empty