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 339 views
1 answer 255 views
1 answer 238 views
1 answer 191 views
1 answer 310 views
1 answer 248 views
...