Last active
August 29, 2015 13:57
-
-
Save MLLeKander/9446347 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
┌─[ 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