fork download
  1. #include <stdio.h>
  2.  
  3.  
  4. div(b,a)
  5. {
  6. typedef struct {char lalk[a];} DIVISOR;
  7. char bytes[b];
  8. return (DIVISOR*)(&bytes)[1] - (DIVISOR*)bytes;
  9. }
  10.  
  11. int main(void)
  12. {
  13. printf ("44 / 3 = %d\n",div(44,3));
  14. printf ("17 / -2 = %d\n",div(17,-2));
  15. printf ("-10 / 5 = %d\n",div(-10,5));
  16. printf ("-7 / -3 = %d\n",div(-7,-3));
  17. return 0;
  18. }
  19. /*
  20. int add(int x, int y) {
  21.   return &((void*)x)[y];
  22. }
  23.  
  24. int mul(int x, int y) {
  25.   return sizeof (char[x][y]);
  26. }
  27.  
  28. */
  29.  
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
prog.c:4:1: warning: type specifier missing, defaults to 'int' [-Wimplicit-int]
div(b,a)
^
prog.c:6:26: error: fields must have a constant size: 'variable length array in structure' extension will never be supported
    typedef struct {char lalk[a];} DIVISOR;
                         ^
1 warning and 1 error generated.
stdout
Standard output is empty