fork download
  1. void fortran_style(var1,var2,var3) float var2; {
  2. printf("var1 = %d,\nvar2 = %.2f,\nvar3 = %d\n",var1,var2,var3);
  3. }
  4.  
  5. float multiple_arguments(){return 0.5f;}
  6.  
  7. const int extern_const_int;
  8.  
  9. typedef enum {
  10. and,and_eq,alignas,alignof,bitand,bitor,bool,catch,char16_t,char32_t,class,
  11. compl,constexpr,const_cast,decltype,delete,dynamic_cast,explicit,export,
  12. false,friend,mutable,namespace,new,noexcept,not,not_eq,nullptr,operator,or,
  13. or_eq,private,protected,public,reinterpret_cast,static_assert,static_cast,
  14. template,this,thread_local,throw,true,try,typeid,typename,using,virtual,
  15. wchar_t,xor,xor_eq
  16. } keywords;
  17.  
  18. typedef struct {
  19. int size;
  20. int data[];
  21. } variable_sized_struct;
  22.  
  23. implicit_int = 4;
  24.  
  25. main(){
  26. volatile int dynamic_val = 55;
  27. int variable_length_array[dynamic_val];
  28. auto float scoped_variable = multiple_arguments(implicit_int,implicit_int,implicit_int,implicit_int);
  29. keywords int_to_enum = 5;
  30. fortran_style(implicit_int,scoped_variable,int_to_enum);
  31. void *void_ptr = malloc(sizeof(variable_sized_struct)+sizeof(int[dynamic_val]));
  32. variable_sized_struct *vssptr;
  33. vssptr = void_ptr;
  34. free(void_ptr);
  35. return 0;
  36. }
  37.  
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
prog.cpp:1:20: error: variable or field 'fortran_style' declared void
prog.cpp:1:20: error: 'var1' was not declared in this scope
prog.cpp:1:25: error: 'var2' was not declared in this scope
prog.cpp:1:30: error: 'var3' was not declared in this scope
prog.cpp:1:48: error: expected unqualified-id before '{' token
prog.cpp:7:11: error: uninitialized const 'extern_const_int'
prog.cpp:10:2: error: expected identifier before 'and' token
prog.cpp:10:2: error: expected '}' before 'and' token
prog.cpp:10:5: error: expected unqualified-id before ',' token
prog.cpp:10:6: error: expected unqualified-id before 'and_eq' token
prog.cpp:16:1: error: expected declaration before '}' token
stdout
Standard output is empty