How to set pointer to function to point to other pointer to function with parameters in C

1 Answer

0 votes
#include <stdio.h>
 
void f(int n) {
    printf("%i\n", n);
}
 
   
int main() 
{ 
	void (*fp1)(int) = f;
	void (*fp2)(int);
     
	(*fp1)(234);
  
	fp2 = fp1;
	(*fp2)(99);
 
	return 0; 
}
 
 
 
/*
run:
 
234
99
 
*/

 



answered Jul 26, 2019 by avibootz

Related questions

2 answers 209 views
1 answer 164 views
1 answer 162 views
1 answer 95 views
1 answer 216 views
1 answer 146 views
...