Last active
March 21, 2016 12:08
-
-
Save Keshizin/77182b3ccfe1fa8eb4d4 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
int soma(int a, int b) { return a + b; } | |
int subtracao(int a, int b) { return a - b; } | |
int operacao(int (*func)(int, int)) | |
{ | |
int a = 10; // solicitar o valor do usuário | |
int b = 10; // solicitar o valor do usuário | |
return (*func)(a, b); // chamada de função | |
} | |
int main() | |
{ | |
int resultado_soma = operacao(soma); | |
int resultado_subtracao = operacao(subtracao); | |
... | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment