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 )
2 odpowiedzi
+ 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