Year 2 compilers coureswork

simple.c 189B

12345678910111213141516171819
  1. int whammy(int a) {
  2. int x = a;
  3. return x + 5;
  4. }
  5. function twice(function f) {
  6. int g(int x) { return f(f(x)); }
  7. return g;
  8. }
  9. int main() {
  10. int b = 4;
  11. int a = b();
  12. return x;
  13. }