Skip to content

Instantly share code, notes, and snippets.

@MLLeKander
Last active August 29, 2015 13:57
Show Gist options
  • Save MLLeKander/9446347 to your computer and use it in GitHub Desktop.
Save MLLeKander/9446347 to your computer and use it in GitHub Desktop.
┌─[ michael@michael-desktop: ~ ]
└─> cat test.java
class test {
public static int f(int a, int b) {
return a + b;
}
public static int g(int f) {
return f(f, 3);
}
public static void main(String[] args) {
System.out.println(g(1));
}
}
┌─[ michael@michael-desktop: ~ ]
└─> javac test.java
┌─[ michael@michael-desktop: ~ ]
└─> java test
4
┌─[ michael@michael-desktop: ~ ]
└─> cat test.c
#include <stdio.h>
int f(int a, int b) {
return a + b;
}
int g(int f) {
return f(f, 3);
}
int main() {
printf("%d\n", g(1));
return 0;
}
┌─[ michael@michael-desktop: ~ ]
└─> gcc test.c -o test
test.c: In function ‘g’:
test.c:8:12: error: called object ‘f’ is not a function
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment