#include <stdio.h> int main() { alignas(int) char buf[2*sizeof(int)]; int *i = (int *) buf; short *s = (short *) buf; *i = 42; s[0] = 0; s[1] = 1; printf("%d", *i); }
Standard input is empty
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
Standard output is empty