fork download
  1. #include <stdio.h>
  2.  
  3. int main()
  4. {
  5. alignas(int) char buf[2*sizeof(int)];
  6. int *i = (int *) buf;
  7. short *s = (short *) buf;
  8.  
  9. *i = 42;
  10. s[0] = 0;
  11. s[1] = 1;
  12.  
  13. printf("%d", *i);
  14. }
  15.  
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
prog.cpp: In function ‘int main()’:
prog.cpp:5: error: expected primary-expression before ‘int’
prog.cpp:5: error: ‘alignas’ was not declared in this scope
prog.cpp:5: error: expected `;' before ‘char’
prog.cpp:6: error: ‘buf’ was not declared in this scope
stdout
Standard output is empty