0

arguements in function to pointer

https://code.sololearn.com/c0AH2H9Ku5Fm hi friends here is my code my doubt is ......can we pass arguments in a pointer to function( which is already passed as an argument to another function )

11th Jul 2019, 5:16 AM
malepu rakesh
malepu rakesh - avatar
1 Respuesta
+ 1
Yes you can, though not that way Write this instead void parameter(int (*fun)(int,int), int a, int b) { fun(a, b); } int main() { parameter(add, 2, 3); parameter(sub, 2, 3); parameter(mul, 2, 3); parameter(division, 2, 3); return 0; } And don't forget to put return 0
11th Jul 2019, 5:36 AM
Agent_I
Agent_I - avatar